Unit 4 Task 3 - Solution

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Solution - Task 3: Price after discount

← Back to task


One possible program:

def discounted_price(price, percent_off):
    return price * (1 - percent_off / 100)

print(discounted_price(100.0, 20))
print(discounted_price(50.0, 10))