0
rent = int("300")
shopping = int("150")
clothes = int("200")
print("you have ", + cash, "dollars")
print("You have 3 options to spend your money")
print("$300 - Rent - 1")
print("$150 - Shopping - 2")
print("$200 - Clothes - 3")
choice = input("Enter a number between 1-3 to choose how you spend your money")

if choice == 1:
    print("you now have", cash - rent, "dollars")
elif choice == 2:
    print("you now have", cash - shopping, "dollars")

the if/elif part will not print the stuff included inside of it.

1 Answers1

1

The return value of input is a string, which cannot equal a number. Change your conditions to choice == "1" and choice == "2".

You should also include .strip() after your call to input just in case the user enters extra whitespace before or after the number. And remember to include an else block to handle the case that they enter something else.

programmer
  • 743
  • 4
  • 10