-1

It can become quite tedious to put multiple variations of spelling into and if statement and I was wondering if there is a way I could make the if statements case insensitive so I only need to put in one thing. I'm just picking up python again and couldn't find a good way online.

1 Answers1

2
In [2]: s = 'aBcDe'                                                                                                                                                                                                                                                                                                           

In [3]: if s.lower() == 'abcde': 
   ...:     print("look! it's case insensitive") 
   ...:                                                                                                                                                                                                                                                                                                                       
look! it's case insensitive
inspectorG4dget
  • 110,290
  • 27
  • 149
  • 241