본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#40 백준 파이썬 [10809] 알파벳 찾기

#40 백준[10809] 알파벳 찾기



https://www.acmicpc.net/problem/10809






#Solution



alphabet = "abcdefghijklmnopqrstuvwxyz"
word_list = []
word_num = []

word = str(input())


for i in word:
word_list.append(i)

for character in alphabet:
for i in range(len(word_list)):
if character == word_list[i]:
word_num.append(i)
break
elif i < len(word_list)-1: continue
else:
word_num.append(-1)
for i in word_num:
print(i,end=" ")