I had to compare two lists and whether the string in the new_users is already available in an existing list then the system should highlight it. I have written following code and it worked. Would you appreciate it if anyone can share an even better way to do the same?
current_users = ["john", "Cindy", "Peter", "Tesla", "Briteny"]
new_users = ["JOHN", "Cindy", "Nomy", "Tesla", "Tina"]
i = 0
for new_user in new_users:
if new_user.lower() == current_users [i].lower():
print ("The user name is already taken")
else:
print ("The user name is available")
i += 1