Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1
- # False case
- false1 => 2 < -1
- false2 => len("python3") < len("Python")
- false3 => "Python3" == "Python"
- false4 => "z" in "Python3"
- false5 => if ["0","1"] == ["1","0"]:
- false6 => if sum(range(1,102)) == 5050:
- false7 => if 2 // 2 == 0:
- false8 => if "Python3".count("P") == 3:
- false9 => if max([1,2,3,4,5]) == 3:
- false10 => if min([1,2,3,4,5]) == 3:
- # True Case
- True1 => 2 > -1
- True2 => len("python3") > len("Python")
- True3 => "Python" == "Python"
- True4 => "n" in "Python3"
- True5 => if ["1","0"] == ["1","0"]:
- True6 => if sum(range(1,101)) == 5050:
- True7 => if 2 // 2 == 1:
- True8 => if "Python3".count("P") == 1:
- True9 => if max([1,2,3,4,5]) == 5:
- True10 => if min([1,2,3,4,5]) == 1:
- # 2
- all() => 반복자를 인자로 받아서 그 내용이 모두 참이면 참을 리턴하는 함수
- any() => 반복자를 인자로 받아서 그 내용 중 하나만 참이어도 참을 리턴하는 함수
- # 3
- word = input()
- print(word[::-1])
- # 4
- word = input()
- word = word.lower().replace(" ", "")
- palindrome_tag = True
- for i in range(0, len(word) // 2):
- if word[i] == word[len(word)-i-1]:
- pass
- else:
- print("This String is not Palindrome")
- palindrome_tag = False
- break
- if palindrome_tag:
- print("This String is Palindrome")
Add Comment
Please, Sign In to add comment