Skip to content

Commit bb79ff5

Browse files
authored
Add documentation examples for consider-using-dict-items. (#6679)
1 parent 8d59af6 commit bb79ff5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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]}")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ORCHESTRA = {
2+
"violin": "strings",
3+
"oboe": "woodwind",
4+
"tuba": "brass",
5+
"gong": "percussion",
6+
}
7+
8+
9+
for instrument, section in ORCHESTRA.items():
10+
print(f"{instrument}: {section}")

0 commit comments

Comments
 (0)