Notice
Recent Posts
Recent Comments
Link
Star_project
[인프런] 3.탐색&시뮬레이션(string, 1차원, 2차원 리스트 탐색 ) 1.회문 문자열 검사 본문
1.회문 문자열 검사
import sys
sys.stdin=open("pythonalgorithm/섹션 3/1. 회문 문자열 검사/in1.txt","rt")
n=int(input())
for i in range(n):
x=input()
x=x.upper()
for j in range(len(x)//2):
if x[j]!=x[-j-1]:
print("#%d NO" %(i+1))
break
else:
print("#%d YES" %(i+1))
x=input() 하면 됨!!
'코딩테스트 > Python' 카테고리의 다른 글
[인프런] 3.탐색&시뮬레이션(string, 1차원, 2차원 리스트 탐색 ) 2.숫자만추출 (0) | 2022.07.12 |
---|---|
[인프런] 2. 자료구조와 알고리즘 입문 10.점수 계산 (0) | 2022.07.12 |
[인프런] 2. 자료구조와 알고리즘 입문 9.주사위 게임 (0) | 2022.07.12 |
[인프런] 2. 자료구조와 알고리즘 입문 8. 뒤집은 소수 (0) | 2022.07.12 |
[프로그래머스] 자릿수 더하기 (0) | 2022.07.11 |