I just started with Python,
Is there any iteration in the dictionary like in PHP
foreach(aData as key=>value)
It looks something like this:
my_dict = {"key1": 1, "key2":2} my_dict.items() # in python < 3 , you should use iteritems() >>> ("key1", 1), ("key2", 2)
so you can iterate:
for key, value in my_dict.items(): do_the_stuff(key, value)
Assuming python 2:
for key, value in aData.iteritems():
Using:
for key in dictionary.keys() value = dictionary[key] #do something
OR:
for key,value in dictionary.items(): #do something