How to use 'python case insensitive string compare' in Python

Every line of 'python case insensitive string compare' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
1079oldValue: The value to replace with newValue.
1080 newValue: The new value of the element at index.

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

56def lower_case_sort(things):
57 if runningPython34:
58 things.sort(key=str.lower)
59 else:
60 # case-insensitive sort
61 things.sort(lambda x, y: cmp(x.lower(), y.lower()))
62 return things # RL: Not sure of this exactly

Related snippets