Question: For each comment, finish the Python command below it to perform the requested action. For each print statement, write out what the Python console would
For each comment, finish the Python command below it to perform the requested action. For
each print statement, write out what the Python console would display when executing it
Assume all lines are executed as a single program.
wallets Betty: currency: one: 'five': 'twenty': # $
'Bobby': photos: baby 'lover'
'ccards':
'currency': hundred: 'twenty': # $
'Sammy': bus: 'pass', 'currency': twenty: 'one': # $
lastnames Betty: 'Smith', 'Sammy': 'Jones', 'Bobby': 'Orr', 'Sally': 'Saver'
values one: 'five': 'ten': 'twenty': 'fifty': 'hundred':
# Get a list of wallet holders from the wallets dictionary in one line
walleteers
# Then what is printed out by this line?
printwalleteers
# Get the contents of Bobby's wallet without using a dot operator
bobbywallet
# Then what is printed out by this line?
printbobbywallet
# Get the number of photos in Bobby's wallet using bobbywallet assigned above
bobbyphotocount
# Then what is printed out by this line?
printbobbyphotocount
# After executing this line:
walletsBobbycurrencyhundred
# What is printed out by this line:
printbobbywalletcurrency
# Does Betty have any hundreddollar bills in her wallet
# use the in keyword and assign a boolean to bettyhasacnote
bettyhasacnote
# Then what is printed out by this line?
printbettyhasacnote
# invert the lastnames dictionary
firstnames
# Then what is printed out by this line?
printfirstnames
# using the values dictionary sum up the value of all the currency in all the wallets
money
for name in wallets:
currency walletsnamecurrency
for bill in currency:
money
# Then what is printed out by this line?
printmoney
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
