To convert a string to lowercase of uppercase following code can be used:
s_lower = s.lower() s_upper = s.upper()
string lowercase example
s = "Hello Python" s2 = s.lower() print s print s2
Hello Python hello python
Env: Python 2.7.18
string uppercase example
s = "Hello Python" s2 = s.upper() print s print s2
Hello Python HELLO PYTHON
Env: Python 2.7.18