https://www.acmicpc.net/problem/13234
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
def sol(s):
s = list(s.split())
s[0]=s[0].capitalize()
s[1] = s[1].lower()
s[2] = s[2].capitalize()
if eval(s[0]+' ' + s[1]+' ' + s[2]):
return 'true'
else:
return 'false'
return
if __name__ == '__main__':
s = input()
print(sol(s))
|
cs |
문자열은 할당이 되지 않아 list로 변환후 eval 함수 사용
String cannot be assigned , So type should be changed to list, and use eval function
반응형
'python-algorithm' 카테고리의 다른 글
백준 7120 String (0) | 2022.12.05 |
---|---|
백준 6438 Reverse Text (1) | 2022.12.05 |
백준 15080 Every Second Counts (0) | 2022.12.04 |
백준 26209 Intercepting Information (0) | 2022.12.04 |
백준 14625 냉동식품 (0) | 2022.12.03 |
댓글