Answered step by step
Verified Expert Solution
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:
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started