How to LowerCase a String in Python
Python comes with a built-in method on all String
types, by calling lower()
on a String, you can immediately lower the case of that String.
An example to LowerCase a String in Python
Now let’s try and see how it may look in a coding challenge:
The challenge
Given a string s
, return the string after replacing every uppercase letter with the same lowercase letter.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= s.length <= 100
s
consists of printable ASCII characters.