Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # chpt2 exercise
- ## 2.11
- ## 2-1
- 1.True
- 2.False
- ## 2-2
- 1.not
- 2.or
- 3.and
- ## 2-3
- ### not
- 1.False
- 2.True
- ### and
- 1.False
- 2.True
- 3.False
- 4.False
- ### or
- 1.True
- 2.False
- 3.True
- 4.True
- ## 2-4
- 1.False
- 2.False
- 3.True
- 4.False
- 5.False
- 6.True
- ## 2-5
- 1.==
- 2.!=
- 3.>
- 4.<
- 5.=>
- 6.=<
- ## 2-6
- 1.当比較演算子 ==
- 2.代入演算子 =
- ## 2-7
- 1.TrueかFalseを評価したいとき
- ## 2-8
- 1.spam ==10:
- 2.spam > 5:
- 3.else:
- ## 2-9
- '''
- if spam == 1:
- print('Hello, spam')
- elif spam == 2:
- print('Howdy, spam')
- else:
- print('Greetings!')
- '''
- ## 2-10
- 1.ctrl + c
- ## 2-11
- breakはループを抜ける continueはスキップする
- ## 2-12
- 同じ
- ## 2-13
- print(range(1,10))
- '''
- i = 1
- while i < 11:
- print(i)
- i += 1
- '''
- ## 2-14
- from spam import bacon
Add Comment
Please, Sign In to add comment