题解 | #禁止重复注册#
禁止重复注册
https://www.nowcoder.com/practice/43acd439112c4b85a9168ad3dd7e2bd1
current_users=["Niuniu","Niumei","GURR","LOLO"]
new_users=["GurR","Niu Ke Le","LoLo","Tuo Rui Chi"]
current_users_low=[]
for i in current_users:
i=i.lower()
current_users_low.append(i)
for item in new_users:
if (item.lower()) in current_users_low:
print("The user name " + item +" has already been registered! Please change it and try again!")
else:
print("Congratulations, the user name " + item + " is available!")
查看6道真题和解析