#๐Ÿ”’ help me

9 messages ยท Page 1 of 1 (latest)

devout kraken
#

bank = 1000
coins = 0
deposit = 0
start = True

#menu#

while start == True:
word = input("What would you like to do, Enter a key word <b> for balance, <c> for coins, <d> for deposit, or <p> to start playing: ")

#deposit#
if word == "d" :
    deposit = input("Enter how much money you want to deposit. You have " + str(bank) + " in your bank : ")
    if int(deposit) < int(bank):
        deposit = int(deposit)
        coins = coins + deposit
        bank = bank - deposit
        print("You have "+ str(coins) + " coins after depositing")
    else:
        while int(deposit) > int(bank):
            deposit = input("You do not have enough, Enter how much money you want to deposit. You have " + str(bank) + " in your bank : ")   
            if int(deposit) < int(bank):
                deposit = int(deposit)
                coins = coins + deposit
                bank = bank - deposit
                print("You have "+ str(coins) + " coins after depositing")
            elif int(deposit) == int(bank):
                deposit = int(deposit)
                coins = coins + deposit
                bank = bank - deposit
                print("You have "+ str(coins) + " coins after depositing")
                






elif word == "b" :
    print("You have "+ str(bank) + " in your bank")

elif word == "c" :
    print("You have "+ str(coins) + " in coins")

#Game started#
if word == "p":
    start = False
    print("You have started the game")
    print("I will proceed to explain the rules of the game and then we can start to play")
wooden cloudBOT
#

Hey @devout kraken!

Please edit your message to use a code block

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
wooden cloudBOT
#

@devout kraken

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

devout kraken
#

if u deposit all your money it will say u dont have enough

#

can some1 help me fix this

limpid sinew
#

You check if int(deposit) < int(bank) to do the deposit. If bank is 1000 and I want to deposit 1000 than deposit is not less than bank. You need to check <= for that.

devout kraken
#

thanks i figured it out

wooden cloudBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.