Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Case Sensitivity
#1
Hello, this is my first post. I'm a complete newbie in coding and I ran into a brick wall. I need to make the comparison between two lists case insensitive and no idea how to incorporate it into the code. I know it has to do something with .lower() but no idea how. I would appreciate the help. Thanks
current_users=['sandra', 'brigita', 'bri','deivis', 'raimis']
new_users=['bri', 'billy', 'minde', 'erika', 'edminrika', 'RAIMIS']
for new_user in new_users:
    if new_user in current_users:
        print(new_user+" "+"already exists."+" "+"You need to choose a different name.\n")
    else:
        print(new_user+" "+"is available.")
Reply


Messages In This Thread
Case Sensitivity - by deivisk - Aug-08-2017, 09:45 AM
RE: Case Sensitivity - by hbknjr - Aug-08-2017, 10:56 AM
RE: Case Sensitivity - by wavic - Aug-08-2017, 11:01 AM
RE: Case Sensitivity - by deivisk - Aug-08-2017, 12:12 PM
RE: Case Sensitivity - by wavic - Aug-08-2017, 01:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Switch case or match case? Frankduc 9 4,634 Jan-20-2022, 01:56 PM
Last Post: Frankduc

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020