Python string Method - islower()

The islower() method is a built-in string method in Python that returns True if all alphabetic characters in the string are lowercase and there is at least one alphabetic character in the string. Otherwise, it returns False.

Here is the syntax of the islower() method:

str.islower()
Sou‮:ecr‬www.theitroad.com

The islower() method does not take any arguments. It can be called on a string and returns a Boolean value.

Example:

# Example 1
string1 = "hello world"
print(string1.islower()) # Output: True

# Example 2
string2 = "Hello World"
print(string2.islower()) # Output: False

# Example 3
string3 = "12345"
print(string3.islower()) # Output: False

# Example 4
string4 = "Hello, World!"
print(string4.islower()) # Output: False

In the above example, string1 is all lowercase letters so islower() method returns True. string2 has uppercase letters so islower() method returns False. string3 does not have any letters, so it returns False. string4 has a mix of uppercase and lowercase letters, so islower() method returns False.