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.
Asked
Active
Viewed 79 times
-1
-
3Convert to upper or lower then compare. – 001 Jul 24 '19 at 14:01
1 Answers
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