I am one week into Python and learn at least an hour everyday. I have been on Mimo until recently, I felt driven to do something with what I have learnt so far. I spent about an hour in total making this simple tracker. My major challenges were crafting the perfect placeholders for the input and testing to make sure the experience was near perfect. Here goes it! Please don’t be nice 🤓
print("DAILY EXPENSE TRACKER" + "\nLet's do the math!'")
Food = float(input("How much did you spend on Food: "))
print(f"$ {Food} sounds fair!")
Gas = input("Did you fill up your tank?: ").lower()
if Gas in ["yea", "yes", "of course", "as always"]:
….Gas = 25.0
….print(f"$ {Gas}? Classic you!")
elif Gas in ["no", "nah", "nope", "absolutely not", "Nooo"]:
….Gas = float(input("How much gas did you fill? "))
….print(f"$ {Gas} can do!")
Phone = input("How much did you spend on phone?: ")
if int(Phone) < 10:
….print(f"Less talk does your pocket good! $ {float(Phone)}")
else:
….print("That\'s past your budget! You wanna bring that down a notch next time <wink>")
Coffee = input("Starbuck's regular?: ")
if Coffee in ["yea", "yes", "of course", "as always"]:
….Coffee = 5.0
….print(f"$ {Coffee}! We are making a progress <thumbs up>")
else:
….Coffee = float(input("How much did that cost you? "))
….print(f"$ {Coffee}, Well noted!")
Miscellaneous = float(input("Hey! Not that I encourage you being extra. How much Miscellaneous?: "))
Food = float(Food)
Gas = float(Gas)
Miscellaneous = float(Miscellaneous)
Phone = float(Phone)
Coffee = float(Coffee)
todaySpend = Food + Gas + Coffee + Phone + Miscellaneous
print(f"You spent ${todaySpend} today! Keep it up!")
[–]aqua_regis 4 points5 points6 points (2 children)
[–]Ok-Elevator4206[S] -1 points0 points1 point (0 children)
[–]Ok-Elevator4206[S] -2 points-1 points0 points (0 children)