728x90 반응형 SMALL python file1 Python - I/O, File I/O, pickle I/O 앞으로 해도 이효리 뒤로 해도 이효리 이렇게 reverse 해도 같은 문장을 #plaindrome 이라고 부른다. plaindrome 을 검사하는 연습문제를 만들어 보자. 매우 간단하다.import re def reverse(text): return text[::-1] def is_plaindrome(text): return text == reverse(text) something = input('enter text:') regexp = '\W' something = re.sub(regexp, '', something) something = something.upper() print(something) if is_plaindrome(something): print('Yes, it is a plai.. 2018. 9. 10. 이전 1 다음 728x90 반응형 LIST