Tell us what’s happening:
Ive not completed the tasks and its saying otherwise i really need to know if my code works and its saying ive completed the assignment
Your code so far
def apply_discount(price, discount):
if type(price) != int and type(price) != float:
return "The price should be a number"
elif type(discount) != int and type (discount) != float :
return "The discount should be a number"
if price <=0:
return "The price should be greater than 0"
if discount <0 or discount >100 :
return "The discount should be between 0 and 100"
def percentage(discount,price):
return price * (discount/100)
final_price = price - percentage(discount, price)
return final_price
apply_discount(100, 20)
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Challenge Information:
Build a Discount Calculator - Build a Discount Calculator