Solution Review: Lower To Uppercase
This lesson will help you change the case of the string using a built-in function.
We'll cover the following
Solution: Use str.upper()
and str.lower()
Given a string “str”, use str.upper()
to convert the string ‘str’ to upper case, and use str.lower()
to convert string ‘str’ to lower case.
For example,
Given a string
str = "AAA bbb CCC"
a = str.upper()
b = str.lower()
Output:
AAA BBB CCC
aaa bbb ccc
The following python code demonstrates how to change the letter case of a string.
Get hands-on with 1400+ tech skills courses.