Jan-05-2019, 03:04 PM
I’m trying to write a script where I create a dictionary with some initial keys and values. I made some of those values above 10 and some less than 10.
sales = {"beef" : 4, "catfish" : 8, "alfredo" : 12, "peppers" : 18}
print(sales)
Now I want to add 2 to each value in the above sales dictionary that I created and print out the new dictionary to verify that the values changed. And then finally, print all dictionary entries with a value less than 10.
sales = {"beef" : 4, "catfish" : 8, "alfredo" : 12, "peppers" : 18}
print(sales)
Now I want to add 2 to each value in the above sales dictionary that I created and print out the new dictionary to verify that the values changed. And then finally, print all dictionary entries with a value less than 10.