Answer the question
In order to leave comments, you need to log in
How to do a case-insensitive comparison in Python?
It is necessary to compare 2 lines, while not taking into account the case in which they are written. The strings 'Hello' 'hello' 'HeLlO' 'hELLo' should compare as equal and output that the name is taken
current_users = ['Yaroslav', 'Misha', 'Grisha', 'Masha', 'Lilya']
new_users = ['Anna', 'Misha', 'Alex', 'Masha', 'Lilya']
for user in new_users:
if user in current_users:
print('Имя занято')
else:
print('Имя свободно')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question