word = "hello"
uppercase_word = word.upper()
print(uppercase_word)
#source code --> clcoding.com
Explanation:
Define the Variable:
word = "hello" stores the lowercase string "hello" in the variable word.
Convert to Uppercase:
word.upper() converts all the letters in "hello" to uppercase, resulting in "HELLO".
The .upper() method is a built-in Python function that changes all characters to uppercase.
Print the Uppercase String:
print(uppercase_word) outputs the converted string "HELLO".
Output:
HELLO
0 Comments:
Post a Comment