I\'m looking for the opposite to this Q&A: Convert an excel or spreadsheet column letter to its number in Pythonic fashion.
or this one but in python How to conv
Just for people still interest in this. The chosen answer by @Marius gives wrong outputs in some cases, as commented by @jspurim. Here is the my answer.
import string
def convertToTitle(num):
title = ''
alist = string.uppercase
while num:
mod = (num-1) % 26
num = int((num - mod) / 26)
title += alist[mod]
return title[::-1]