Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python iterate through dictionary

a_dict = {'apple':'red', 'grass':'green', 'sky':'blue'}
for key in a_dict:
  print key # for the keys
  print a_dict[key] # for the values
 
PREVIOUS NEXT
Tagged: #python #iterate #dictionary
ADD COMMENT
Topic
Name
8+2 =