Python String islower()
Python String islower() method returns True if each of the alphabet present in given string is only a lowercase alphabet (a-z).
If the string contains one or more uppercase alphabets, then islower() returns False.
In this tutorial, we will learn the syntax and examples for islower() method of String class.
Syntax
The syntax of String islower() method in Python is
str.islower()
Examples
In the following program, we take a string 'abcd@123'
, and check if this string does not contain any uppercase alphabets using str.islower()
method.
Example.py
x = 'abcd@123'
result = x.islower()
print(result)
Output
True
In the following program, we take a string 'Abcd@123'
, and check if this string contains alphabets that are of only lowercase, using str.islower()
method. Since the string contains uppercase alphabet A
, islower() returns False.
Example.py
x = 'Abcd@123'
result = x.islower()
print(result)
Output
False
Conclusion
In this Python Tutorial, we learned how to check if given string contains alphabets that are only lowercase, using String method – islower().