migrate to git.charlotte.sh
This commit is contained in:
commit
fbd588721e
412 changed files with 13750 additions and 0 deletions
14
python-csi160/midterm/part1.py
Normal file
14
python-csi160/midterm/part1.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
"""
|
||||
Do not use AI! You can schedule to try again if you have a bad grade!
|
||||
Basic Function Write a function named exactly "calculate_discounted_price" which receives 2 parameters: price(float)
|
||||
and discount(float) in percentage, and returns the final price after applying the discount.
|
||||
|
||||
Example:
|
||||
print(calculate_discounted_price(100, 10)) # Output: 90.0
|
||||
print(calculate_discounted_price(50, 50)) # Output: 25.0
|
||||
"""
|
||||
def calculate_discounted_price(price, discount):
|
||||
return price - (price * discount * .01)
|
||||
|
||||
print(calculate_discounted_price(100,10))
|
||||
print(calculate_discounted_price(50,50))
|
Loading…
Add table
Add a link
Reference in a new issue