"%.2f" % total....want explation of this syntax meal = 44.50 tax = 0.0675 tip = 0.15 meal = meal + meal * tax total=meal+ meal*tip print("%.2f" % total)
%f right? It allows you to print a float. just like
%s is a placeholder for a string, that much make sense?
.2 inside the
%f allows us to specify the amount of decimal numbers we want, in this case 2.