Help for 8/13 - Keeping Track of the Produce


#1

It LOOKS like I did the coding right but whenever I try to run the code, everything repeats itself 4 times and I don’t know why. There’s also an issue with the spacing. Everything is so packed together and it just looks really messy and unreadable. I don’t know how to fix it.

Please excuse the name btw


#2

you have four loops, each loop loops over the dictionary, the dictionary has 4 keys, which will be printed by each loop

You only need one for loop, otherwise you could have just write a lot of print statements, but then you violate DRY (don’t repeat yourself) principal.


#3

alright, i think i realized what i was doing wrong and i seem to have fixed it. but my question is, is it supposed to be in a specific order or not since i pulled from the dictionary?


#4

no, dictionaries are unordered by nature, given they use keys and not indexes


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.