commit 40047fce905edceb6487955955e1563d7e682cab Author: Logen Kain Date: Mon Aug 17 12:20:51 2020 -0400 init diff --git a/cost-of-smokes.py b/cost-of-smokes.py new file mode 100644 index 0000000..0e09983 --- /dev/null +++ b/cost-of-smokes.py @@ -0,0 +1,36 @@ +#!/usr/bin/python3 +#user input dolloars +#user input number of packs +#output day, week, month year costs +import os +cost = None +packs = None + +while True: + os.system('clear') + try: + cost = float(input("How much does a pack cost? ")) + except ValueError: + print("Please only type numbers") + continue + + try: + packs = float(input("How many packs do you smoke a day? ")) + except ValueError: + print("Please only type numbers") + continue + break + +print() +print("You smoke: ") +print(20 * packs, "per day") +print(20 * packs * 7, "per week") +print((20 * packs * 365)/12, "per month") +print(20 * packs * 8 * 365, "per year") +print() +print("This costs you: ") +print(cost * packs, "Per day") +print(cost * packs * 7, "per week") +print((cost * packs * 365)/12, "per month") +print(cost * packs * 365, "per year") +