When accepting user input with a decimal in Python I'm using:
#will input meal subtotal
def input_meal():
mealPrice = input('Enter the meal subtotal: $')
mealPrice = float (mealPrice)
return mealPrice
which returns exactly what is entered - say $43.45
but when using that value to calculate and display tax I'm using:
#will calculate 6% tax
def calc_tax(mealPrice):
tax = mealPrice*.06
return tax
which returns a display of $ 2.607 using
mealPrice = input_meal()
tax = calc_tax(mealPrice)
display_data(mealPrice, tax)
How can I set that to $2.61 instead?
Forgive me, I realize this is basic stuff but they don't call it Intro for nothing...
Thanks!