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 8% 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
1
#grade (write your code in this cell and DO NOT DELETE THIS LINE)
2
def add_tax(price, add_tax_or_not):
3
price =340
4
add_tax = False
5
6
if add_tax
7
price = price *.8
1
# make one call to your function here
1
# 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!