Write a program that is given a dictionary containing the average daily temperature for each day of the week, and prints all the days on which the average temperature was between 40 and 50 degrees in python

Code

# create dictionary
d1 = {'Monday': 45, 'Tuesday': 40, 'Wednesday': 50, 'Thursday': 55, 'Friday': 60, 'Saturday': 65, 'Sunday': 70}

# print dictionary
print(d1)

# iterate over dictionary
for key, value in d1.items():
if value >= 40 and value <= 50:
print(key, value)


Output