From 82d15a69ef4a2f610d30774ce7566cdc0ec129c5 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Mon, 17 Aug 2020 13:10:46 -0400 Subject: [PATCH] fix year calculation; fix per smoke decimal --- cost-of-smokes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cost-of-smokes.py b/cost-of-smokes.py index 135f302..14ad2d4 100644 --- a/cost-of-smokes.py +++ b/cost-of-smokes.py @@ -27,14 +27,14 @@ while True: break -print("Your cigarettes cost", cost/20, "each") +print("Your cigarettes cost", format(cost/20, '.2f'), "each") print() print("You smoke: ") print(math.ceil(20 * packs), "per day") print(math.ceil(20 * packs * 7), "per week") print(math.ceil((20 * packs * 365)/12), "per month") -print(math.ceil(20 * packs * 8 * 365), "per year") +print(math.ceil(20 * packs * 365), "per year") print()