我是编程新手,请尽量用简单的话回答。 这是我的密码
username = ['dante', 'ares', 'zues', 'death', 'admin']
if username:
for user in username:
if user == 'admin':
print('Hello admin,would you like to see a status report?')
username.remove(user)
else:
print(f"Welcome {user},hope you have a good time!")
username.remove(user)
else:
print("we need to find users!")
输出:
Welcome dante,hope you have a good time!
Welcome zues,hope you have a good time!
Hello admin,would you like to see a status report?
预期产出:
Welcome dante, hope you have a good time!
Welcome ares, hope you have a good time!
Welcome zues, hope you have a good time!
Welcome death, hope you have a good time!
Hello admin, would you like to see a status report?
We need to find users!
相关问题 更多 >
编程相关推荐