Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Speedy category for Excel Column Number by tlprice1969
def column_number(name: str) -> int:
# your code here
import string
collector = []
for e in range(0, len(name)):
collector.append((string.ascii_uppercase.index(name[e]) + 1)*(26**(len(name) - (e+1))))
return sum(collector)
print("Example:")
print(column_number("AA"))
assert column_number("A") == 1
assert column_number("Z") == 26
assert column_number("AB") == 28
assert column_number("ZY") == 701
print("The first mission is done! Click 'Check' to earn cool rewards!")
Feb. 12, 2022