Halmos sign in sign up

Column 76686766181 in Excel called INFINITY

1 point by mageoftheeast 1 hour ago
python
def colname(x):
    if x == 0:
        return ''
    else:
        (q, rm1) = divmod(x - 1, 26)
        return colname(q) + chr (ord ('A') + rm1)

a = 76686766181
print (colname (a))
print (colname (a) == 'INFINITY')
ran63 ms
INFINITY
True

Sign in to reply.

No comments yet.