Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Excel Column Number by 126083
def column_number(name: str) -> int:
total = 0
for i, j in enumerate(name[::-1]):
total += (ord(j) - 64) * (26 ** i)
return total
print("Example:")
print(column_number("AA"))
# These "asserts" are used for self-checking
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!")
Jan. 11, 2023