QuestionQ14

VerifiedData Collections – Tuples, Dictionaries, Lists, and Strings

Assume that Barry Lyndon’s phone number is 5551234567.

Arrange the code boxes to create a valid line of code that makes a relevant phone-directory entry in the phone_dir dictionary. "Barry Lyndon" is the key.

Drag & Drop
   
Explanation

A Python dictionary assignment uses dictionary_name = {key: value}. The name phone_dir is assigned a dictionary whose key is the string "Barry Lyndon" and whose value is the string "5551234567".

Community Discussion

No comments yet. Be the first to start the discussion!