Python小程序问题
一名python初学者,做习题写了下面的程序:检查新用户不能和老注册用户重名,包括大写。就是不运行,也查不出问题,哪位给指点一下,谢谢。
current_users=("john","tom","parker","kitty","helen","Golden")
new_users=["alice","tom","peter","alex","kitty"]
current_users_lower=[]
for user_1 in current_users:
current_users_lower.append(user_1.lower())
for new_user in new_users:
if new_user.lower() in current_users_lower:
print(new_user+" has already exist!")
else:
print(new_user+" is ok")
[此贴子已经被作者于2019-9-24 09:52编辑过]