How python uses dictionaries to store switch
This article mainly shows you "how python uses dictionaries to store switch". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how python uses dictionaries to store switch".
Use dictionaries to store switch.
We can make a dictionary to store expressions.
Stdcalc = {'sum': lambda x, y: X + y,' subtract': lambda x, y: X-y} print (stdcalc ['sum'] (9) print (stdcalc [' subtract'] (9) # 1-> 12: 2-> 6 is all the contents of the article "how python uses dictionaries to store switch". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!