Python Program to Convert Uppercase to Lowercase

« Previous Program Next Program »

Convert Uppercase to Lowercase in Python

To convert uppercase character or string to lowercase character or string in python, you have to ask from user to enter a string or character to convert the given string or character into lowercase string or character using the function lower() as shown here in the program given below. You can also convert uppercase character to lowercase character with your own.

Python Programming Code to Convert Uppercase to Lowercase

Following python program ask from user to enter string and convert it into lowercase string:

# Python Program - Convert Uppercase to Lowercase

print("Enter 'x' for exit.");
string = input("Enter any string in uppercase to convert in lowercase: ");
if string == 'x':
    string_in_lowercase = string.lower();
    print("\nSame String in Lowercase =",string_in_lowercase);

Here is the sample run of the above Python program illustrating how to convert uppercase to lowercase string:

uppercase to lowercase python

Now enter any string say THIS is CODESCRACKER and press enter to see the same string in lowercase after converting it into lowercase as shown here:

uppercase to lowercase conversion python

Same program on python shell:

python convert uppercase to lowercase

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test