by R4R Team

- upper() is a python string function which convert the given string into the uppercase letters.

Example

string is "my string"
required string is "MY STRING"

string is "Worning123"
required string is "WORNING123"


program-


print("Enter string")
s=input()
s=s.upper()
print("String in Upper case is ",s)

s="mytext"
print(s.upper())
s="mytext123"
print(s.upper())


output-


Enter string
this is string
String in Upper case is THIS IS STRING
MYTEXT
MYTEXT123


-In this program, firstly we take input of string in lowercase and using s.upper() we convert lowercase string into uppercase string and again stored and print that string.




Leave a Comment: