name=input ("please enter your name") .upper()
names=["MARTIN","JAMES","LOUIS","BABYSHARK"]
if name==list:names
print ("You are allowed to play my game")
else
prin ("ACCES DENIED!"))
答案 0 :(得分:5)
您的解决方案可能就是这个:
names=["MARTIN","JAMES","LOUIS","BABYSHARK"]
name = input('Enter your name:').upper()
if name in names:
print('You can play my game')
else:
print('Access Denied')
答案 1 :(得分:2)
您需要在if和else语句之后添加冒号。另外,您还需要在if段中缩进代码。