题解 | #禁止重复注册#

current_users = ['Niuniu','Niumei','GURR','LOLO']
current_users1 = [x.lower() for x in current_users]


new_users = ['GurR','Niu Ke Le','LoLo','Tuo Rui Chi']
new_users1 = [x.lower() for x in new_users] 

result1 = [1 if x in current_users1  else 0 for x in new_users1 ]

for i in range(len(result1)):
    if result1[i] == 1:
        print('The user name',new_users[i] ,'has already been registered! Please change it and try again!')
    else:
        print('Congratulations, the user name',new_users[i],'is available!')

全部评论

相关推荐

10-28 11:04
已编辑
美团_后端实习生(实习员工)
一个2人:我说几个点吧,你的实习经历写的让人觉得毫无含金量,你没有挖掘你需求里的 亮点, 让人觉得你不仅打杂还摆烂。然后你的简历太长了🤣你这个实习经历看完,估计没几个人愿意接着看下去, sdk, 索引这种东西单拎出来说太顶真了兄弟,好好优化下简历吧
点赞 评论 收藏
分享
2 收藏 评论
分享
牛客网
牛客企业服务