Write a Python script that takes input from the user and displays that input back in upper and lower cases


This program is written in the Python programming language and it converts a given string to uppercase and lowercase. It does this in three steps:

  • The first step is to get the input string from the user using the "input" function. The input string is stored in the variable "str".
  • The program then prints the original string "str" to the console.
  • The next two steps use the built-in methods "upper" and "lower" to convert the string "str" to uppercase and lowercase, respectively. The modified strings are stored in two separate variables and are printed to the console using the "print" function.

Source Code

str = input("Enter the String :")
print("Given String :",str)
print("UpperCase :"+ str.upper())
print("LowerCase :"+ str.lower())

Output

Enter the String :Tutor Joes
Given String : Tutor Joes
UpperCase :TUTOR JOES
LowerCase :tutor joes


Example Programs