Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a dictionary. a) Implement a dictionary car with the keys brand, model, and color. Give appropriate values for each key. b) Print the

image text in transcribed
image text in transcribed
1. Create a dictionary. a) Implement a dictionary car with the keys brand, model, and color. Give appropriate values for each key. b) Print the value for each element in the list. c) Add a key transmission to the dictionary with the value automatic'. d) Print the value for the key transmission. Output Example Tesla Model 5 black automatic 2. Create a dictionary. a) Implement a dictionary car with the keys brand, model, and color. Give appropriate values for each key. b) Use a loop and the items() method to print all keys and values. c) Use a loop and the keys () method to print all keys and values. d) Use a loop and the values() method to print all values. Output Example brand Tesla model Model 5 color black brand Tesla model Model 5 color black Tesla Model 5 black 3. Nest dictionaries within a list. a) Implement five car dictionaries with the keys brand and model. Add appropriate values for each key. b) Create a list cars and add all dictionaries to this list. c) Use a loop to print all model values from the list of cars. Output Example Model 5 Model 3 X5 x3 x2 4. Nest dictionaries within a dictionary. a) Implement two doctor dictionaries with the keys name and patient. The key name contains the name of the doctor. The key patient is a dictionary with two keys, firstName and lastName. Add appropriate values for all keys. b) Create a list doctors and append both dictionaries to this list. c) Use a loop to output each doctor and their patient's names. Output Example John: Jane : | IU Yeon Charles Times

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions