- 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

10th Feb 2017, 8:24 PM
Prince Kelvin
Prince Kelvin - avatar
3 Answers
11th Feb 2017, 3:03 AM
visph
visph - avatar
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.
10th Feb 2017, 9:00 PM
ChaoticDawg
ChaoticDawg - avatar
- 1
thanks @chaoticdawg
18th Feb 2017, 3:09 PM
Prince Kelvin
Prince Kelvin - avatar