183,631 views
2 votes
2 votes
Write a statement to add the key Tesla with value USA to car makers Modify the car maker of Fiat to Italy Sample output for the given program Acura made in Japan Fiat made in Italy Tesla made in USA 1 car makers (Acura: 3apan,iat:"tpt 3Add the key Tesla wth value USA to car nakers 4 oalfy the car meker of iat to Ita2y Your solution goes here 6 8 print(Acura nade in, carakerst'Acura1 print(Fat ade incar malcersFlat 10 oristTesla nade in, carakers'Tesla3 O O Type bere to search 8

User Bakamike
by
3.8k points

1 Answer

6 votes
6 votes

Answer:

The modification code is :

car_markers ={"Tesla":"USA", "Fiat":"Italy"} #modification code

car_markers['Acura'] = 'Japan' #modification code

Step-by-step explanation:

In this question the dictionary car_makers is not mention clearly.The correct dictionary of car_makers is given below:

car_markers = {'Acura':'Japan', 'Fiat':'Egypt'} #as mention in the question

car_markers ={"Tesla":"USA", "Fiat":"Italy"} #modification code

car_markers['Acura'] = 'Japan' #modification code

print('Acura made in',car_markers['Acura']) #as mention in the question

print('Fiat made in',car_markers['Fiat']) #as mention in the question

print('Tesla made in',car_markers['Tesla'])#as mention in the question

Following are the description of code

  • Create a dictionary car_makers .In this dictionary we store 'USA' in the key value 'Tesla' ,'Italy' in the key 'Fiat' .
  • In the next line we store 'japan' in the key 'Acura'.
  • Finally print the value in the respective format.
User Grozav Alex Ioan
by
3.0k points