質問するログイン新規登録

回答編集履歴

2

リンク化

2020/02/10 11:32

投稿

shiracamus
shiracamus

スコア5406

answer CHANGED
@@ -26,7 +26,7 @@
26
26
  ```
27
27
 
28
28
  ちなみに、「PEP8: Pythonコードのスタイルガイド」には、真偽値変数と True/False を比較するなと書いてあります。
29
- https://pep8-ja.readthedocs.io/ja/latest/
29
+ [https://pep8-ja.readthedocs.io/ja/latest/](https://pep8-ja.readthedocs.io/ja/latest/)
30
30
  > ブール型の値と True や False を比較するのに == を使うのはやめましょう。:
31
31
  > ```
32
32
  良い: if greeting:

1

PEP8での記述について追記

2020/02/10 11:32

投稿

shiracamus
shiracamus

スコア5406

answer CHANGED
@@ -23,4 +23,13 @@
23
23
  False
24
24
  >>> bool([0])
25
25
  True
26
+ ```
27
+
28
+ ちなみに、「PEP8: Pythonコードのスタイルガイド」には、真偽値変数と True/False を比較するなと書いてあります。
29
+ https://pep8-ja.readthedocs.io/ja/latest/
30
+ > ブール型の値と True や False を比較するのに == を使うのはやめましょう。:
31
+ > ```
32
+ 良い: if greeting:
33
+ 悪い: if greeting == True:
34
+ もっと悪い: if greeting is True:
26
35
  ```