2020-08-17 12:20:51 -04:00
|
|
|
#!/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")
|
2020-08-17 12:35:10 -04:00
|
|
|
input("Press 'enter' to continue: ")
|
2020-08-17 12:20:51 -04:00
|
|
|
continue
|
|
|
|
|
|
|
|
try:
|
|
|
|
packs = float(input("How many packs do you smoke a day? "))
|
|
|
|
except ValueError:
|
|
|
|
print("Please only type numbers")
|
2020-08-17 12:35:10 -04:00
|
|
|
input("Press 'enter' to continue: ")
|
2020-08-17 12:20:51 -04:00
|
|
|
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")
|
|
|
|
|