怎么写才能在比较时候不区分大小写?Lion和liON不区分大小写对比,并打印出已被占用。
current_users = ['Tifa', 'Ada', 'Lightning', 'Lion', 'Natasha']
new_users = ['Tifa', 'Ada', 'Lucifer', 'liON', 'Michael']
#下面是我写的代码,该如何在用户名为liON时打印出'Username is uese'?
for new_user in new_users:
print(new_user)
if new_user in current_users:
print('Username is uesd')
else:
print('Username is not used')