我正在为我的项目创建一个授权代码,当每个玩家输入代码时,我都找不到隐藏它的方法。我并没有真正尝试找到方法,但是我查看了stackoverflow却找不到它。我会向您展示我正在使用的代码,因为这可能会对您有所帮助。
def playerone():
global authorityone
authorityone = input("Player 1 what is the authorisation code to enter the game.\n")
if authorityone == "3004":
global usernameone
usernameone = input("What is your username going to be.\n")#this allows the user to input there own unique name to be saved in the leader board
print(usernameone,"is your new username!")
playertwo()
else:
mainmenu()