반응형
해결 방법
def colnum_string(n):
string = ""
while n > 0:
n, remainder = divmod(n - 1, 26)
string = chr(65 + remainder) + string
return string
print(colnum_string(28))
#output:AB
참조 페이지 https://stackoverflow.com/questions/23861680
반응형
'파이썬' 카테고리의 다른 글
파이썬 How to delete all blank lines in the file with the help of python? (0) | 2020.12.14 |
---|---|
파이썬 분산 데이터 세트를 사용하여 MatPlotLib에서 히트 맵 생성 (0) | 2020.12.14 |
파이썬 Python, print delimited list (0) | 2020.12.14 |
파이썬 Python의 연산자 오버로딩에 대한 종합 가이드 (0) | 2020.12.14 |
파이썬 Add column with constant value to pandas dataframe (0) | 2020.12.14 |
댓글