Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 14 (1 point) What is the result of the following statement? contacts = { Fred: 7235591, Mary: 3841212, Bob: 3841212, Sarah: 2213278) Fred in

image text in transcribed
image text in transcribed
image text in transcribed
Question 14 (1 point) What is the result of the following statement? contacts = { "Fred": 7235591, "Mary": 3841212, "Bob": 3841212, "Sarah": 2213278) "Fred" in contacts Error False True None Question 15 (1 point) What is the result of the following statement? Mycontacts = [ "Fred": 7235591, "Mary": 3841212) print(list(Mycontacts.keys)) O ["Fred": 7235591, "Mary": 3841212] O('Fred', 'Mary) O ("Fred": 7235591. "Mary": 3841212) Ol'Fred'. "Mary] Question 16 (1 point) Consider the following variable. Mycontacts = [ "Fred": 7235591, "Mary": 3841212) what happens when we try to retrieve a value using the expression Mycontacts Isusan"]? It is executed fine and no exception is raised, and it returns None Since "susan" is not a key in the set. Python raises a syntax error Since "susan" is not a key in the set. Python raises a keyError exception. Since susan" is not a value in the set. Python raises a keyError exception

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 DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

Students also viewed these Databases questions