Question: Write a function that takes a price and a boolean value indicating whether to add tax. The value of the boolean will determine whether or
Write a function that takes a price and a boolean value indicating whether to add tax. The value of the boolean will determine whether or not you add a tax to the price. If the boolean value is true, we will add an tax to price and then return the total. If the boolean value is false, we will just return the price.
To check that your function works, you'll want to call it with some different inputs and see what the results are!
Make sure to save inside Jupyter before going back to the question page and clicking on Submit & Grade
#grade write your code in this cell and DO NOT DELETE THIS LINE
def addtaxprice addtaxornot:
price
addtax False
if addtax
price price
# make one call to your function here
# make another call to your function here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
