https://www.acmicpc.net/problem/5358
5358번: Football Team
Print the same list of names with every ‘i’ replaced with an ‘e’, every ‘e’ replaced with an ‘i’, every ‘I’ replaced with an ‘E’, and every ‘E’ replaced with an ‘I’.
www.acmicpc.net
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
def sol(s):
answer = ''
for alphabet in s:
if alphabet == 'i':
answer+='e'
elif alphabet == 'I':
answer+='E'
elif alphabet == 'E':
answer += 'I'
elif alphabet == 'e':
answer += 'i'
else:
answer += alphabet
return answer
if __name__ == '__main__':
while 1:
try:
s = input()
print(sol(s))
except:
break
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
백준 26561 Population (0) | 2022.12.23 |
---|---|
백준 26736 Wynik meczu (0) | 2022.12.23 |
백준 26332 Buying in Bulk (0) | 2022.12.22 |
백준 26531 Simple Sum (0) | 2022.12.22 |
백준 6825 Body Mass Index (0) | 2022.12.22 |
댓글