Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Goal: Learn to remove elements from a dictionary Goal: Learn to dynamically create dictionaries. Assignment: Whole numbers are the numbers 1 , 2 , 3

Goal: Learn to remove elements from a dictionary Goal: Learn to dynamically create dictionaries.
Assignment: Whole numbers are the numbers 1,2,3, and so on. Write some code that assigns
to inverted a dictionary that maps the first n whole numbers to their inverse (1n).squares ={} square = number **2return squares
n =5
squares = create_squares_dict(n)Question 4
Feedback
More information
{1:1,2:4,3:9,4:16,5:25}
Feedback:
Expected variable 'inverted' to exist tuple_2=(1,2,3)
dct = dict(zip(tuple_1, tuple_2))
{'a': 1,'b': 2,'c': 3}Question 5
(\times ) Feedback
More information
No output.
Feedback:
Expected dct to equal {1: 'A',2: 'E',3: 'I',4: 'O',5: 'U'} but got {'a': 1,'b': 2,'c': 3}.
Assignment: Assume the variable iso_3166 refers to a dictionary mapping each country's name
to its Alpha-2 code. Write some code that deletes the element with key "East Timor" and sets its
mapped value to the new key "Timor-Leste".iso_3166["Timor-Leste"]= "East Timor"Question 3
Feedback
More information
No output.
Feedback:
Expected key 'East Timor' to not exist
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

What is a pro forma earnings number?

Answered: 1 week ago

Question

Factors Affecting Conflict

Answered: 1 week ago

Question

Describe the factors that lead to productive conflict

Answered: 1 week ago

Question

Understanding Conflict Conflict Triggers

Answered: 1 week ago