나의 풀이
from string import ascii_lowercase
alphabet_list = list(ascii_lowercase)
print(alphabet_list)
def solution(age):
a=[]
b=''
for i in str(age):
p=int(i)
result=alphabet_list[p]
a.append(result)
for j in a:
b= b +j
return b
모범답안
def solution(age):
return ''.join([chr(int(i)+97) for i in str(age)])
'프로그래머스(파이썬) > LV.0(파이썬)' 카테고리의 다른 글
개미군단 (0) | 2022.11.16 |
---|---|
진료 순서 정하기★ (0) | 2022.11.15 |
치킨 쿠폰★ 갱신의 논리 (0) | 2022.11.15 |
특이한 정렬★★ - 리스트 통째 + 정렬기준★ (0) | 2022.11.15 |
저주의 숫자3 (0) | 2022.11.14 |