I have this code:
import random
money = 50
bet = int(input("You have 50 dolars, how much money would you like to bet?"))
if bet > money:
print("You don't have all that money!")
elif bet <= money:
money = money - bet
guess = int(input("Choose one number in between 1 and 10"))
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
random_numbers = random.choice(numbers)
print("The number drawn was:", random_nada, "!")
if guess == random_number:
money = money + bet +bet
print("Congratulations! You guessed right and doubled you bet! You now have:", ponto, "!")
else:
print("You guessed wrong and lost the value that you bet. You now have:", ponto, ".")
ans = input("Would like to play again?")
if ans == "yes" or ans == " yes": print("You guessed wrong and lost the value that you bet. You now have:", ponto, ".")
ans = input("Would like to play again?")
if ans == "yes" or ans == " yes"
here i wanted the code to restart but without losing the current value of "money", or else the player would just have 50 dolars at the start regardless of how much he won or lost beting along the game.