Skip to content

Commit

Permalink
Improve tip_calc.py output
Browse files Browse the repository at this point in the history
  • Loading branch information
pamims committed May 23, 2022
1 parent dd40a61 commit 08ad165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Day002/Tip_Calculator/tip_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
tip_percent = float(tip_percent) / 100;
cost = float(cost)
cost_per_person = round(cost * (1 + tip_percent) / num_people, 2);

cost_per_person = "{:.2f}".format(cost_per_person);
print(f"Each person should pay ${cost_per_person}.");

0 comments on commit 08ad165

Please sign in to comment.