You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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)
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)
Activity
HWMNBN commentedon Sep 30, 2022
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)
Ch3nk commentedon Feb 11, 2023
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)
main()
will do the job aswell
7777xm commentedon Dec 24, 2023
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)