There was an error while loading. Please reload this page.
1 parent be90cfe commit ac70ff5Copy full SHA for ac70ff5
Dictionary/main7.py
@@ -0,0 +1,17 @@
1
+# Definite Loops and Dictionaries
2
+
3
+# Even though dictionaries are not stored in order,
4
+# we can write a for loop that goes through all the
5
+# entries in a dictionary - actually it goes
6
+# through all of the keys in the dictionary and
7
+# looks up the values
8
9
+count = {'chuck' : 1, 'fred' : 42, 'jan' : 100}
10
+for key in count:
11
+ print(key, count[key])
12
13
+# Output
14
15
+# chuck 1
16
+# fred 42
17
+# jan 100
0 commit comments