Skip to content

Tag: dictionary

Executing functions through dictionaries

My script executes depending on user’s input, like this: The problem is that I can have over 15 different choices, so I would like to make it cleaner using dicts, but I can’t get it to work. This is what I did. In the class init for sh: And so on. Further down in the class: And finally the input

how to print everything from a dictionary?

I’m trying to do this question for class that is really confusing me, I can’t seem to figure it out. They give me this code and say that I need to do something to make it print all of the flowers in the dictionary instead of printing just one. Here is the code that is provided, which just prints o…