Challenge 1
Add the expected prompt result for the discount example so doctest verifies the documented return value.
import doctest
def discounted_price(price, percent):
"""Return the price after a percentage discount.
>>> discounted_price(50, 20)
"""
return price * (1 - percent / 100)
result = doctest.testmod(verbose=True)
assert result.failed == 0
Press Ctrl⌘Enter to check your answer