Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!