ページへ戻る
− Links
印刷
基本的には他の言語のif文と同じ a = 1 if a == 1: print "a is 1" 結果 a is 1 「かつ」は「and」、「または」は「or」。 他の言語を知っていると、「&&」や「||」にしがちだが、それはエラーとなる。 a = 1 b = 2 if a == 1 and b == 2: print "a is 1 and b is 2"
(This host) = https://njf.jp