0
current_users = ['bigdawg', 'lildawg', 'pepsilover', 'pepsihater', 'jill']

new_users = ['Bigdawg', 'lildawg', 'cocacola_lover', 'notJill']

for new_user in new_users:
    if new_user in current_users:
        print("Sorry, username is taken!")
    elif new_user.title() in current_users:
        print("Sorry, username is taken!")
    elif new_user.upper() in current_users:
        print("Sorry, username is taken!")
    elif new_user.lower() in current_users:
        print("Sorry, username is taken!")
    else:
        print(f"Welcome, {new_user}!")`enter code here

I tried using or but I ended up having it spit out that the username was taken.

  • Does [this](https://stackoverflow.com/questions/3627784/case-insensitive-in) answer your question? – sudden_appearance Feb 13 '22 at 00:13
  • If you normalize the casing of the names in `current_users` (e.g. all lower-case), then you can always find a name in its lower-cased form, without needing to try anything else. – Alexander Feb 13 '22 at 00:20

0 Answers0