Guest User

Untitled

a guest
Jul 12th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. # chpt2 exercise
  2.  
  3. ## 2.11
  4. ## 2-1
  5.  
  6. 1.True
  7. 2.False
  8.  
  9. ## 2-2
  10.  
  11. 1.not
  12. 2.or
  13. 3.and
  14.  
  15. ## 2-3
  16.  
  17. ### not
  18.  
  19. 1.False
  20. 2.True
  21.  
  22. ### and
  23.  
  24. 1.False
  25. 2.True
  26. 3.False
  27. 4.False
  28.  
  29. ### or
  30.  
  31. 1.True
  32. 2.False
  33. 3.True
  34. 4.True
  35.  
  36. ## 2-4
  37.  
  38. 1.False
  39. 2.False
  40. 3.True
  41. 4.False
  42. 5.False
  43. 6.True
  44.  
  45. ## 2-5
  46.  
  47. 1.==
  48. 2.!=
  49. 3.>
  50. 4.<
  51. 5.=>
  52. 6.=<
  53.  
  54. ## 2-6
  55.  
  56. 1.当比較演算子 ==
  57. 2.代入演算子 =
  58.  
  59. ## 2-7
  60.  
  61. 1.TrueかFalseを評価したいとき
  62.  
  63. ## 2-8
  64.  
  65. 1.spam ==10:
  66. 2.spam > 5:
  67. 3.else:
  68.  
  69. ## 2-9
  70.  
  71. '''
  72. if spam == 1:
  73. print('Hello, spam')
  74. elif spam == 2:
  75. print('Howdy, spam')
  76. else:
  77. print('Greetings!')
  78. '''
  79.  
  80. ## 2-10
  81.  
  82. 1.ctrl + c
  83.  
  84. ## 2-11
  85.  
  86. breakはループを抜ける continueはスキップする
  87.  
  88. ## 2-12
  89.  
  90. 同じ
  91.  
  92. ## 2-13
  93.  
  94. print(range(1,10))
  95. '''
  96. i = 1
  97. while i < 11:
  98. print(i)
  99. i += 1
  100. '''
  101. ## 2-14
  102.  
  103. from spam import bacon
Add Comment
Please, Sign In to add comment