So I just wanna ask that how to get score system between two def function ao if made a score system in first def function and I made a score of 150 how to continue score in second def function from 150 only I tried the global command but it didn't work pls give me solution Here's my code
def play():
money=100
print("you have been given 100 coins for free at start")
money=money-25
number=(input("What will you choose 7up , 7down , 7: "))
if number=="7up":
import random
print("the random generated number is:")
gen=(random.randrange(1,12))
print(gen)
if gen > (7):
print("the random generated number is greater than 7.")
print("congratulation u got 50 coins")
money=money+50
print("Your current money is")
return (money)
elif gen < (7):
print("the random generated number is not greater than 7.")
print("congratulation u got nothing")
print("Your current money is")
return (money)
elif gen == (7):
print("the random generated number is 7.")
print("congratulation u got nothing")
print("Your current money is")
return (money)
if number=="7down":
import random
print("the random generated number is:")
gen=(random.randrange(1,12))
print(gen)
if gen > (7):
print("the random generated number is greater than 7.")
print("congratulation u got nothng")
print("Your current money is")
return (money)
elif gen < (7):
print("the random generated number is not greater than 7.")
print("congratulation u got 50 coins")
money=money+50
print("Your current money is")
return (money)
elif gen == (7):
print("the random generated number is 7.")
print("congratulation u got nothing")
print("Your current money is")
return (money)
if number == "7":
import random
print("the random generated number is:")
gen=(random.randrange(1,12))
print(gen)
if gen > (7):
print("the random generated number is greater than 7.")
print("congratulation u got nothng")
print("Your current money is")
return (money)
elif gen < (7):
print("the random generated number is not greater than 7.")
print("congratulation u got nothng")
print("Your current money is")
return (money)
elif gen == (7):
print("the random generated number is 7.Wow lucky.")
print("congratulation u got 100 coins")
money=money+100
print("Your current money is")
return (money)
def playagain():
Money= global money
return (Money)