Write a while loop which prompts the user for the name of a drink and the cost. Add these new items to the drinks_dict. When the user enters "quit", exit the loop. Be sure to cast the value for the cost to a float. Spring Water 1.25 Sparkling Water 2.00 exit Use the values() method to access the values in drinks_dict. Use a loop to print out the values. Use the keys() method to access the keys in drinks_dict. Use a loop to print out the keys. Print the code and the output from the Python Shell. Compute the sum of all of the values for the drinks. Print out the sum. Print the code and the output from the Python Shell. Write a function named find drink_function() that takes two parameters a dictionary and a key: If the key is in the dictionary, return True, otherwise return False. Call the function from within main with the following arguments: drinks_dict and "Tea". Assign the returned Boolean value to a variable found. Print out the value of found. Print the code and the output from the Python Shell,

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a while loop which prompts the user for the
name of a drink and the cost. Add these new
items to the drinks_dict. When the user enters
"quit", exit the loop. Be sure to cast the value for
the cost to a float.
Spring Water 1.25
Sparkling Water 2.00
exit
Use the values() method to access the values in
drinks_dict. Use a loop to print out the values.
Use the keys() method to access the keys in
drinks_dict. Use a loop to print out the keys.
Print the code and the output from the Python
Shell.
Compute the sum of all of the values for the
drinks. Print out the sum.
Print the code and the output from the Python
Shell.
Write a function named find_drink_function(0 that
takes two parameters a dictionary and a key: If the
key is in the dictionary, return True, otherwise
return False.
Call the function from within main with the
following arguments: drinks_dict and "Tea". Assign
the returned Boolean value to a variable found.
Print out the value of found.
Print the code and the output from the Python
Shell.
Transcribed Image Text:Write a while loop which prompts the user for the name of a drink and the cost. Add these new items to the drinks_dict. When the user enters "quit", exit the loop. Be sure to cast the value for the cost to a float. Spring Water 1.25 Sparkling Water 2.00 exit Use the values() method to access the values in drinks_dict. Use a loop to print out the values. Use the keys() method to access the keys in drinks_dict. Use a loop to print out the keys. Print the code and the output from the Python Shell. Compute the sum of all of the values for the drinks. Print out the sum. Print the code and the output from the Python Shell. Write a function named find_drink_function(0 that takes two parameters a dictionary and a key: If the key is in the dictionary, return True, otherwise return False. Call the function from within main with the following arguments: drinks_dict and "Tea". Assign the returned Boolean value to a variable found. Print out the value of found. Print the code and the output from the Python Shell.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY