Here we are going to learn all about the Python string islower() method along with examples to check a string all the characters in the string are lower or not.
In the previous tutorial, we have seen the string isidentifier() method to check identifier.
Headings of Contents
Python String islower() method:
The Python string islower() method is used to check whether a string has all lowercase characters or not.
If the string contains all lowercase characters, It returns True otherwise it returns False.
Syntax:
The syntax of the python string islower() method is:-
string.islower()
Parameter:
The Python string islower() method does not support any parameter.
Return Type:
islower function in python return Boolean value: True or False.
Let’s see an example for using the python islower() string method.
Python string islower Examples:
Here we will take some examples to understand islower function in python.
Example 1:
str = "python"
str2 = str.islower()
print(str2)
The output will be True.
Example 2:
str = "python 1213"
str2 = str.islower()
print(str2)
The output will be True because it checks only characters.
Example 3:
str = "PROGRAMMING"
str2 = str.islower()
print(str2)
The output will be False.
Example 4:
str = "Programming"
str2 = str.islower()
print(str2)
The output will be False.
Note:- Python string islower function check only characters, not numbers, symbols, and spaces.
Conclusion
In this tutorial, you have learned the pythons string islower() method to check all the characters in the string are lower case or not.
If all the characters are lowercase, then it returns True otherwise it returns False.
I hope this tutorial will help you. if you like this article, please share it with your friends who want to learn Python programming from scratch to advanced.
- String endswith() method
- String casefold() method
- String center() method
- String capitalize() method
- String count() method
- String index() method
- String format() method
- String isalpha() method
For More Information:- Click Here