I am given either a single character or a string, and am using Python.
How do I find out if a specific character has a lowercase equivalent according to the standards (standard and special case mappings) proposed by Unicode?
And how do I find out if a string has one or more characters that have a lowercase equivalent according to the standards (standard and special case mappings) proposed by Unicode?
This will only work correctly in as much as the Python version you’re using has correctly implemented the
.lower()method per unicode standards, of course. Also, I’m assuming that you don’t consider, e.g.,u'a', to “have a lowercase equivalent” (it has an uppercase one of course). If you mean something different, consider(I’ve renamed the argument to
ucto avoid excessive line length;-) — if that’s what you want I recommend not naming the function in terms of “lowercase equivalent” as that would be sure to confuse readers/maintainers of your code!-)