May 2017
Intermediate to advanced
280 pages
6h 2m
English
Let's see one by one, first is the lower() method.
The syntax for the lower() method is given as follows:
str1.lower()
The lower() method returns a string in which all case-based characters are present in lowercase. Let's see an example:
>>> name = "Mohit RAJ1234">>> name.lower()'mohit raj1234'>>> name'Mohit RAJ1234'>>>
You can see that case-based characters get converted into lowercase; as we know that the string is immutable, the original string remains the same. If you like uppercase, you can use the upper() method.
The syntax for the upper() method is given as follows:
str1.upper()
The upper method returns a copy of string str1, which contains all uppercase characters. Consider the following example:
>>> name ...
Read now
Unlock full access