Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BlockPy: #43.1) Dictionaries vs. Tuples Create a dictionary to store the dimensions for a box. Then, create a tuple to store the dimensions. Finally, give

BlockPy: #43.1) Dictionaries vs. Tuples

Create a dictionary to store the dimensions for a box. Then, create a tuple to store the dimensions. Finally, give an example of accessing the same value in both the dictionary and tuple representation and printing them. You should only print one value from each of the two data structures.

Length: 6

Width: 8

Height: 4

This is the code I have written:

a_dictionary= {"Length" : 6, "Wdith" : 8, "Height" : 4} a_tuple = (6, 8, 4)

print(a_dictionary["Length"]) print(a_tuple[0])

and i keep getting this response: "You need the three keys Length, Height, and Width."

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

More Books

Students also viewed these Databases questions