Python Program to Iterate Over Dictionaries Using for Loop (Access both key and value without using items())

bookmark

dt = {'a': 'juice', 'b': 'grill', 'c': 'corn'}

for key in dt:
    print(key, dt[key])

 

Output

a juice
b grill
c corn