Question: Using for loop to iterate over the following dictionary D = { a 1 : 1 9 0 0 , b 2

Using for loop to iterate over the following dictionary D={"a1":1900,"b2": 1100,"c3": 300,"d4": 1050,"f5": 3200,"g4": 400} and if statement to check if the value is greater than 1000. If the value is greater than 1000, subtract 1000 from the value, for each key in the dictionary D, and add it to the new list L=[]. Otherwise if the value is less then 1000, just append the value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!