Python Program to Convert String to Upper Case

By | August 16, 2019

Task: Write a Python Program to  Convert a given String to Upper Case.

The Source Code of Python Program to Convert String to Upper Case

# Write a Python program to
# input a string and change into
# upper case
# The user will enter String
# during program execution
# author: www.EasyCodeBook.com


# Start of program

# display message to enter string
# and get input string
str1 = input("Enter a string to convert into UPPER CASE:")


# use upper() method
upper_string = str1.upper()

# now print UPPER CASE string
print(str1, "in UPPER CASE =", upper_string)

The output of the Python Program

Enter a string to convert into UPPER CASE:hello python programming
hello python programming in UPPER CASE = HELLO PYTHON PROGRAMMING

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *