Convert a String to uppercase or lowercase with python

If our string is “hello”
we can make it upper with upper()
s=”hello”

s.upper()

it will be HELLO

And in the same way if we want to make it lowercase

we will just use

lower()

s.lower()

It will again hello

The code


x="Hello"
print(x.lower()) #hello

print(x)       #Hello

x=x.lower()
print(x)       #hello