Question
Python programming : Store all of the lists in a dictionary named 'information', ID = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
Python programming:
Store all of the lists in a dictionary named 'information', ID = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'], first_name = ['Tim', 'Marco', 'Hans', 'steven', 'Robin', 'Wesley', 'Patrick', 'Ryan', 'Donny', 'Frenkie'], last_name = ['Jones', 'Harry', 'Anthony', 'Grant', 'Lee', 'James', 'Daniel', 'Henderson', 'Williams', 'Scott'], age = [27, 24, 18, 26, 33, 31, 19, 21, 37, 25]. The ID is the key, and the value is a nested dictionary. The keys in the nested dictionary are first_name, last_name, and age, with the corresponding values.
Example:
print(information['1'])
>>>{'1', {'first_name': 'Tim', 'last_name': 'Jones', 'age': 27 }}
print(information['10']['age'])
>>>25
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started