Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. # 1
  2. # False case
  3. false1 => 2 < -1
  4. false2 => len("python3") < len("Python")
  5. false3 => "Python3" == "Python"
  6. false4 => "z" in "Python3"
  7. false5 => if ["0","1"] == ["1","0"]:
  8. false6 => if sum(range(1,102)) == 5050:
  9. false7 => if 2 // 2 == 0:
  10. false8 => if "Python3".count("P") == 3:
  11. false9 => if max([1,2,3,4,5]) == 3:
  12. false10 => if min([1,2,3,4,5]) == 3:
  13.  
  14. # True Case
  15. True1 => 2 > -1
  16. True2 => len("python3") > len("Python")
  17. True3 => "Python" == "Python"
  18. True4 => "n" in "Python3"
  19. True5 => if ["1","0"] == ["1","0"]:
  20. True6 => if sum(range(1,101)) == 5050:
  21. True7 => if 2 // 2 == 1:
  22. True8 => if "Python3".count("P") == 1:
  23. True9 => if max([1,2,3,4,5]) == 5:
  24. True10 => if min([1,2,3,4,5]) == 1:
  25.  
  26. # 2
  27. all() => 반복자를 인자로 받아서 그 내용이 모두 참이면 참을 리턴하는 함수
  28. any() => 반복자를 인자로 받아서 그 내용 중 하나만 참이어도 참을 리턴하는 함수
  29.  
  30. # 3
  31. word = input()
  32. print(word[::-1])
  33.  
  34. # 4
  35. word = input()
  36. word = word.lower().replace(" ", "")
  37. palindrome_tag = True
  38.  
  39. for i in range(0, len(word) // 2):
  40. if word[i] == word[len(word)-i-1]:
  41. pass
  42. else:
  43. print("This String is not Palindrome")
  44. palindrome_tag = False
  45. break
  46. if palindrome_tag:
  47. print("This String is Palindrome")
Add Comment
Please, Sign In to add comment