Need help with Game Of Chance

Hello everyone, recently I finished one part of “Game of chance” project, however, I would like to know, how may I modify the code such that, the user has some balance, the user can enter the balance, then the he can bet. If the bet is greater than balance, it should say “You don’t have sufficient balance” otherwise it should loop until balance reaches 1000. The minimum balance should be greater than 1500 and minimum bet should be 500.
here is my code:

Well you’ve written out what you wanted. Next step is to work out the logic to make it happen. You can ignore the rest of the script if needs be for now. All you’re after to start with is an integer value and a way of testing if it’s between two limits and to print some warnings if not. Sounds like a function to me.

Make a start and if there’s a piece of logic you can’t transfer to code then pop back and provide the details on that.