题解 | #禁止重复注册#

禁止重复注册

https://www.nowcoder.com/practice/43acd439112c4b85a9168ad3dd7e2bd1

from operator import ne
current_users = ['Niuniu','Niumei','GURR','LOLO']
new_users     = ['GurR','Niu Ke Le','LoLo','Tuo Rui Chi']
current_users_t= []

for name in current_users:
    current_users_t.append(name.lower())

for name in new_users:
    if name.lower() in current_users_t:
        print(f"The user name {name} has already been registered! Please change it and try again!")
    else:
        print(f"Congratulations, the user name {name} is available!")

将两个列表内的名字都转成小写再比较

全部评论

相关推荐

也许是天气_:放在双9简历池里也是中上简历,没人指导一是看不懂,二是可能在偷偷抄你简历亮点。如果大厂0面,多半是卡学历了。我觉得你这情况不愁offer,找工作跟投资一样的,90%的时间都是在等待。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务