Python dictionary and list example

dict1.py

Temperature = {

‘Jan’:[9,12,13,14,15,16],             

‘Feb’:[11,12,16,12,13,14.5],             

‘Mar’:[10,12,11,12,10,12.5]

}
print(“Month wise Temperature”)

print(Temperature)

print(“\n”)print(“\nListing Month – Temperature”)

for month, temp in Temperature.items():   

       print(“Month %s : %s” % (month,temp))

 

Output

dict1

 

 

Published by Python programming examples for beginners

Abhay Gadkari is an IT professional having around experience of 20+ years in IT industry. He worked on web technologies and databases with Insurance and ERP projects.