如何在 Python 中使 if 语句不区分大小写

How To Make An If Statement Case Insensitive In Python

将多种拼写变体放入 if 语句中会变得非常乏味,我想知道是否有一种方法可以使 if 语句不区分大小写,因此我只需要放入一个东西。刚刚又在捡python,网上没找到好的方法

In [2]: s = 'aBcDe'                                                                                                                                                                                                                                                                                                           

In [3]: if s.lower() == 'abcde': 
   ...:     print("look! it's case insensitive") 
   ...:                                                                                                                                                                                                                                                                                                                       
look! it's case insensitive