Python Program to Convert Lowercase to Uppercase

« Previous Program Next Program »

Convert Lowercase to Uppercase in Python

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

Python Programming Code to Convert Lowercase to Uppercase

Following python program ask from user to enter any string to convert that string from lowercase to uppercase:

# Python Program - Convert Lowercase to Uppercase

print("Enter 'x' for exit.");
string = input("Enter any string to convert in uppercase: ");
if string == 'x':
    string_in_uppercase = string.upper();
    print("\nString in Uppercase =",string_in_uppercase);

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

lowercase to uppercase python

Now enter any string say in lowercase say this IS codescracker. Here as you can see the word IS is in uppercase, but you don't have to worry about it, the above program will convert all the string's character into uppercase, either it is in lowercase or in uppercase.

After supplying the string, press enter to convert the same string in uppercase:

convert lowercase to uppercase python

Same program on python shell:

python convert lowercase to uppercase

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