Build a discount calculator

Please I have help with this, I was certain my code was right but it fails, and the hint always seems to be something I’ve already done (e.g name a function apply_discount)

def apply_discount(price, discount):
    if not isinstance(price, (int, float)):
        return “The price should be a number.”
    if not isinstance(discount, (int, 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.”
    return price - (price * discount / 100)

Also sorry but I’m new and wasn’t sure the best way to ask this.

Please re-post your code formatted as follows:


When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

I’ve updated my op with back ticks, thank you for letting me know how to do that.

Check your validation messages. They should match the text in the instructions exactly, including punctuation, or lack thereof.

I’ve updated my op with back ticks, thank you for letting me know how to do that.

Thanks for the reply but I have done this several times and punctuation matches correctly.

Edit: you were right I added extra punctuation. Thank you for the help!