python if 语句问题 当我用for 循环+ == 可以输出 if的print ,但当将for循环去掉,无论输入什么都会得到第二个print的语句 。

图片说明

你可以这样写

name = input()
names = [ "admin", "nukon", ... ]
if name in names:
  print("hello %s, welcome to the system" % name)
else:
  print("no such user")