Consider using FoldedCase from jaraco.text:
>>> from jaraco.text import FoldedCase>>> FoldedCase('Hello World') in ['hello world']True
And if you want a dictionary keyed on text irrespective of case, use FoldedCaseKeyedDict from jaraco.collections:
>>> from jaraco.collections import FoldedCaseKeyedDict>>> d = FoldedCaseKeyedDict()>>> d['heLlo'] = 'world'>>> list(d.keys()) == ['heLlo']True>>> d['hello'] == 'world'True>>> 'hello' in dTrue>>> 'HELLO' in dTrue