I\'m new to Python and could really use some help on this. I want to create a function to filter which files I want to open and which months and day specifically. That way,
You should use str.casefold
to remove case sensitivity. As per the docs, this is stricter than str.lower
:
str.casefold()
Return a casefolded copy of the string. Casefolded strings may be used for caseless matching.
Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter 'ß' is equivalent to "ss". Since it is already lowercase, lower() would do nothing to 'ß'; casefold() converts it to "ss".
For example:
x = 'ßHello'
print(x.casefold())
sshello