Aug-08-2019, 06:28 PM
Why would it be written like that? It's written the way it is because that made sense to Guido.
You keep using the work iteration, I don't think you understand what it means. This:
You keep using the work iteration, I don't think you understand what it means. This:
temp['id'] = idIs assigning to an index. That assigns a single value to a single key in the dictionary. This is plain old indexing (getting a single value out of a dictionary):
id = temp['id']Iteration is for loops. So this would be iteration:
for key in temp: print(key, temp[key])That gets all the keys out of the dictionary. Generally, you get all the key/value pairs out of the dictionary together with the items method:
for key, value in temp.items(): print(key, value)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures