Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coffee orders made simple. Ask the user for white or black coffee Ask for their chosen size: small, medium or large Then print the cost:

  1. Coffee orders made simple.
  • Ask the user for white or black coffee
  • Ask for their chosen size: small, medium or large
  • Then print the cost: For Black: Small = $3, Medium = $4, Large = $5.
  • White coffee costs $1 more no matter what size is chosen, e.g., a white medium is $5.
  • If a user makes a mistake with either part of their order, just pick the most expensive option in each case :)
  • E.g., a purple small coffee would cost $4, a black tiny coffee would cost $5, and a green extra small would cost $6. (This can be done by thinking about the default case for each user input.)
  • Note: You can use the string methods.upper()or.lower()to make your string comparisons case-insensitive, e.g.,
string = input("Prompt: ").lower() if string == "string": print("It matches without capitals") 

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions