lower() method convert a string to lower case, whereas upper() method convert a string to upper case.
string_case.py
message = "Hello World"
lowercase_message = message.lower()
uppercase_message = message.upper()
print(message)
print(lowercase_message)
print(uppercase_message)
Output
$python3 string_case.py Hello World hello world HELLO WORLD
No comments:
Post a Comment