我试图建立一个这样的商店系统:
def Command():
Command = input("Press \"C\" to continue and earn $1 or \"S\" to go to the Shop! -->")
def Display_Shop():
print ("Buy stuff at the Shop like:")
print ("")
print ("Double Money - Gives you $2 instead of $1")
item = input("Which item do you want?")
if item == ("Double Money"):
doubleMoney = True
print("Added (Double Money)")
Work1()
def Work1():
Chop = input('Type \"C\" to earn $1 -->')
global Win
if Chop == ('C') and Win == False:
global gold
global Command
time.sleep(1)
print ('$1 earned')
if doubleMoney == True:
gold = gold+2
if doubleMoney == False:
gold = gold+1
displayMoney()
Chop = 0
Command()
if gold == 100:
Win = True
Work1()
我的问题是,每次我运行它,我都会看到问题:
"Press \"C\" to continue and earn $1 or \"S\" to go to the Shop! -->"
我键入“S”并注册为“C”并运行Work1()。我该如何解决这个问题,以便注册为“S”?请尽快回复。谢谢!