Skip to content

run out of funds run out of fun or nah #1

Open

Description

@HWMNBN

when the balance is null after spinning we need to deposit more.

soo in the spin function i believe this is needed

if total_bet > balance <= 0:
print(f" You do not have enough to bet that amount, your current balance is: ${balance}")
main()

Activity

  1. HWMNBN commented on Sep 30, 2022

    @HWMNBN
    Author

    dont really know how to use github to fix it myself.. yet.

    also "quit()" is needed instead of break for the block containing

    if answer == "q":
    quit()

    i fixed these problems after the tutorial was finished
    (pat on my back bc i did it by myself didnt think it would wwork and took bout 3 to 4 hours but i got it yay me!! and yay education)

  2. reopened this on Sep 30, 2022
  3. Ch3nk commented on Feb 11, 2023

    @Ch3nk

    def main():
    balance = deposit()
    while True:
    print(f"Current balance is ${balance}")
    if balance <= 0:
    print("You've lost everything :'(")
    answer = input(f"Press enter to Start (q to quit)")
    if answer == "q":
    quit()
    else:
    main()
    answer = input(f"Press enter to play (q to quit)")
    if answer == "q":
    quit()
    balance += spin(balance)

    print(f"You left with ${balance}")
    

    main()

    will do the job aswell

  4. 7777xm commented on Dec 24, 2023

    @7777xm

    I'm fairly new to python and this walk through was great. I understood a lot of it but there are parts of it that were still beyond what I know. I got stuck in a loop when my balance reached zero. I'm not sure it was a proper way to get out of it but I added to the main function. It printed out and exited as expected.

    if balance == 0:
    print("You lost all of your money!")
    break
    else:

    Updated.
    def main():
    balance = deposit()
    while True:
    print(f"Current balance is ${balance}")
    if balance == 0:
    print("You lost all of your money!")
    break
    else:
    answer = input("Press enter to play (q to quit).")
    if answer == "q":
    break
    balance += spin(balance)

    print(f"You left with ${balance}")
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions