- 3
Urgent help needed in python
Im developing a python program that prints requirements for starting differnt businesses as we all know businesses are of two types either large scale or small scale so each business type(either small scale or large scale) is gonna have its different requirements so i want to have the user first of all input the business he wants to start, followed by the type (small scale or large scale) before the program now prints the requirements for the inputted business type. how do i organize into dictionaries
3 ответов
+ 3
Two days ago:
https://www.sololearn.com/Discuss/208078/how-can-i-manipulate-JUMP_LINK__&&__python__&&__JUMP_LINK-dictionaries
https://www.sololearn.com/Discuss/208423/problem-with-python-dictionaries
One hour before this one:
https://www.sololearn.com/Discuss/210884/urgent-help-needed-in-python
Try to stand on one thread for one question, to not make Sololearn discuss worst than they already are ^^
0
You could use 2 dictionaries or use one with 2 nested dictionaries:
businesses = {"large":{"businessName": "info", "businessName": "info", ...},
"small":{"businessName": "info", "businessName": "info", ...}}
businesses["large"]["businessName"] # to access an individual large business
businesses["large"] # to access the large group of businesses
The nice part about doing it this way is that it translates to JSON very easily.
- 1
thanks @chaoticdawg