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!"))
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')
您的解决方案可能是:
欢迎使用堆栈溢出。我建议你读the python documentation about if statements。这清楚地定义了语法。最常见的漏掉的是在你的
if
和else
之后的冒号。你知道吗您需要在if和else语句后添加冒号。您还需要缩进if段中的代码。你知道吗
相关问题 更多 >
编程相关推荐