回答編集履歴

2

修正

2019/07/04 07:45

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  >type sample1.py
22
22
 
23
- print(1 in range(3))
23
+ print(1 not in range(3))
24
24
 
25
25
 
26
26
 

1

追記

2019/07/04 07:45

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -9,3 +9,37 @@
9
9
 
10
10
 
11
11
  **引用元**: [PEP 8 -- Style Guide for Python Code | Python.org](https://www.python.org/dev/peps/pep-0008/#programming-recommendations)
12
+
13
+
14
+
15
+ ---
16
+
17
+ pycodestyle先生にもお伺いを立ててみました。
18
+
19
+ ```
20
+
21
+ >type sample1.py
22
+
23
+ print(1 in range(3))
24
+
25
+
26
+
27
+ >python -m pycodestyle sample1.py
28
+
29
+
30
+
31
+ >type sample2.py
32
+
33
+ print(not 1 in range(3))
34
+
35
+
36
+
37
+ >python -m pycodestyle sample2.py
38
+
39
+ sample2.py:1:7: E713 test for membership should be 'not in'
40
+
41
+ ```
42
+
43
+
44
+
45
+ not inを使え、とのことです。