Python 3
for field, possible_values in fields.items():
print(field, possible_values)
Since Python 3 iteritems()
is no longer supported. Use items()
instead.
Python 2
You need to use something like iteritems
.
for field, possible_values in fields.iteritems():
print field, possible_values
See this answer for more information on iterating through dictionaries, such as using items()
, across python versions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…