# Build a Discount Calculator - Build a Discount Calculator

**URL:** <https://forum.freecodecamp.org/t/build-a-discount-calculator-build-a-discount-calculator/780136>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [February 25, 2026, 4:30am UTC](https://forum.freecodecamp.org/t/build-a-discount-calculator-build-a-discount-calculator/780136 "2026-02-25T04:30:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tedevelynmosby](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tedevelynmosby/32/410865_2.png) [@tedevelynmosby](https://forum.freecodecamp.org/u/tedevelynmosby)\
**Post date:** [February 25, 2026, 4:30am UTC](https://forum.freecodecamp.org/t/build-a-discount-calculator-build-a-discount-calculator/780136/1 "2026-02-25T04:30:05Z")

</div>

### Tell us what’s happening:

I tried to check for if the discount is a number or not, but the box doesn’t get checked. Instead, I checked the 9th box.. What’s the problem here?

### Your code so far

```py
def apply_discount(price, discount):
    if type(price) == int or type(price) == float:
        return(price)
    else:
        return('The price should be a number')

        if type(discount) == int or type(discount) == float:
            return(discount)
        else:
            return('The discount should be a number')

```

### Your browser information:

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

### Challenge Information:

Build a Discount Calculator - Build a Discount Calculator

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/python-v9/lab-discount-calculator/build-a-discount-calculator)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![Teller](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/teller/32/412338_2.png) [@Teller](https://forum.freecodecamp.org/u/Teller)\
**Post date:** [February 25, 2026, 4:34am UTC](https://forum.freecodecamp.org/t/build-a-discount-calculator-build-a-discount-calculator/780136/2 "2026-02-25T04:34:17Z")

</div>

Welcome to the forum @tedevelynmosby

To help you debug, add these print calls after the function:

```auto
print(apply_discount(200, 50))
print(apply_discount(50, 0))

```

Happy coding

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [March 25, 2026, 4:34am UTC](https://forum.freecodecamp.org/t/build-a-discount-calculator-build-a-discount-calculator/780136/3 "2026-03-25T04:34:52Z")

</div>

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