Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A store has a sale starting soon. Following code calculates and prints the discount for an item given its category and price. discount = 0
A store has a sale starting soon. Following code calculates and prints the discount for an item given its category and price. discount = 0 if (category == "sports"): if (price > 100): discount = 0.2 elif (price > 200): discount = 0.3 elif (category == "apparel"): if (price > 200): discount = 0.15 elif (price > 75): discount = 0.10 else: discount = 0.05 else: discount = 0.02 print("Discount: ", discount) For each of the cases below, what will be the output of the print statement above? Read the code carefully and follow it closely. a summer dress worth $75 (category="apparel, price=75): a tennis racket worth $255 (category = sports", price= 255): a cookware set worth $120 (category="kitchen, price=120)
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