We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
consider-using-dict-items
1 parent 8d59af6 commit bb79ff5Copy full SHA for bb79ff5
doc/data/messages/c/consider-using-dict-items/bad.py
@@ -0,0 +1,10 @@
1
+ORCHESTRA = {
2
+ "violin": "strings",
3
+ "oboe": "woodwind",
4
+ "tuba": "brass",
5
+ "gong": "percussion",
6
+}
7
+
8
9
+for instrument in ORCHESTRA: # [consider-using-dict-items]
10
+ print(f"{instrument}: {ORCHESTRA[instrument]}")
doc/data/messages/c/consider-using-dict-items/good.py
+for instrument, section in ORCHESTRA.items():
+ print(f"{instrument}: {section}")
0 commit comments