2018-03-22から1日間の記事一覧
「配列内要素が10で割り切れるか」を判定するif文を考えてみる。 if sum([5, 5]) % 10 == 0: print(True) else: print(False) -> True 書き方いろいろ その1 print(True if sum([5, 5]) % 10 == 0 else False) -> True その2 print(False if (5 + 5) % 10 el…
「配列内要素が10で割り切れるか」を判定するif文を考えてみる。 if sum([5, 5]) % 10 == 0: print(True) else: print(False) -> True 書き方いろいろ その1 print(True if sum([5, 5]) % 10 == 0 else False) -> True その2 print(False if (5 + 5) % 10 el…