Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code using Python - Jupiter Notebook Q6 (1 Point) Consider the following variable. In [ ] : M myvar ={1:{ 'name': 'joe', 'age' : 20

Code using Python - Jupiter Notebook

image text in transcribed

Q6 (1 Point) Consider the following variable. In [ ] : M myvar ={1:{ 'name': 'joe', 'age' : 20 },2:{ 'name': 'john', 'age' : 30 } In [ ]: M \#6.1: What is the type of this variable. In [ ]: M \#6.2: We want to show joe as the result of the following code, \# complete the following command such that it shows joe. print(myvar??) In [ ]: M \#6.3: We want to add a new element to this variabe, \#the person that we want to add is Mike, 25 years old. \# complete the following commands. myvar[3]={} myvar[3][?] = 'Mike' myvar[3][?] = 25 print(myvar) In [ ]: 1 \#6.4. Now, we want to find the average of ages. \# complete the following commands. x= ? for var1 in myvar.?(): x+= myvar[?]['age'] mean =x/ len (myvar) print(mean)

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

=+1. Describe the value chain of the media industry!

Answered: 1 week ago

Question

=+3. Draw the submodels of an integrated business model!

Answered: 1 week ago