After I type 5 usernames, it stops itself. How can I prevent that.
username = ['admin','bill','kevin','mike','nick']
for user in username:
name = input("Please enter a username: ")
if name == 'admin':
print("Hello "+ name.title() + " ,would you like to see a status report?")
else:
if name in username:
print("Hello " + name.title() + " thank you for logging in!")
else:
if name not in username:
print("Who are you " + name.title() + " ? ")
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…