Build an Apply Discount Function - Build an Apply Discount Function

Tell us what’s happening:

I’m having trouble with the final 5 steps help would be appreciated

Your code so far

def apply_discount(price, discount):
    if not isinstance(price, (int, float)):
        return "The price should be a number"
    elif not isinstance(discount, (int, float)):
        return "The discount should be a number"
    elif (price <= 0):
        return "The price should be greater than 0"
    elif (discount < 0 or discount > 100):
        return "The discount should be between 0 and 100"

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36

Challenge Information:

Build an Apply Discount Function - Build an Apply Discount Function

Welcome to the forum @dylan.kanakri !

If you buy a shirt that costs $80, and you get a discount of 5%, how much do you owe for the shirt?

Happy coding!

1 Like

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Help button image located on each challenge. This will automatically import your code in a readable format and pull in the challenge URL while still allowing you to ask any question about the challenge or your code.

Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.