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