I think the biggest improvement that you can make is to use functions instead of putting all functionality in one big block of code. Print("That's ok, we will keep your money for next time you play.") Print("We have deposited your balance of £",ballance,"into your bank account.") Withdraw = input("Would you like to withdraw your money? ").lower() Print("Your final balance was: £", ballance) Please deposit more money to keep playing. Print("Your balance is now: £",ballance+outcome)Īgain = input("Would you like to play another round? ").lower()ĭeposit = input("You have run out of money. Print("You made: £",outcome - bet,"So got £",outcome,"back.") Print("Please enter a numerical amount.")īet = input("Please enter how much you'd like to bet on this spin: £") Print("Thank you your balance is currently: £",ballance+deposit) Print("There is 5 options on the wheel:")ĭeposit = input("Please deposit money to play: £") It all seems to be working fine (I think), but I was wondering if there were any improvements to the structure and efficiency of my code I could make. I'm new to Python and coded this spin-the-wheel game where the user can bet on each spin of the wheel and either double their money, 1.5x their money, lose their money or keep it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |