def main():
#this program calculates the total price of a meal after inputting cost of food
#tip and sales tax
print ('Welcome to the Meal Calculator Program')
print()
#get the cost of food using the input function
food_cost = input ("Please enter the price of your meal: ")
food_cost = float (food_cost)
#calculate tip
tip_rate = input ("Tip rate used today is: ")
tip_rate = float (tip_rate)
#calulate sales tax
tax_rate = input ("Tax rate used today is: ")
tax_rate = float (tax_rate)
#calculate total cost here, using inputted values
total_cost = food_cost + (food_cost * tip_rate) + (food_cost * tax_rate)
print ('The total cost based on', format(food_cost, '.2f'),\
'food cost,', format(tip_rate, '.2f'),\
'tip rate, and', format(tax_rate, '.2f'),\
'tax rate is : $', format(total_cost, '.2f'),sep=' ')
#calls main
main()
Essentially, I would like to know how I would go about inputting a food cost, our example is 23.45, and in the output, getting $23.45 . Also, for tip rate, if I input .2, is there a way to get 20% in the output? Or input a percentage?