Instagram
youtube
Facebook
Twitter

Convert Lowercase Characters to Uppercase in a String

A Python program to convert all lowercase characters in a string to uppercase using the .upper() method.

Explanation of the Code:

  1. input("Enter a string: ") → Takes user input as a string.
     
  2. .upper() → Converts all lowercase letters in the string to uppercase.
     
  3. string = input("Enter a string: ").upper() → Stores the uppercase version of the input string in string.
     
  4. print("Uppercase string:", string) → Prints the converted uppercase string.


Program:

string = input("Enter a string: ").upper()

print("Uppercase string:", string)