Python String islower() method
Python String islower() method
The string.islower() method returns a boolean value true if all cased characters in the string are lowercase and for any other value is returns false otherwise.
Syntax
string.islower()
Parameter
NA
Return
This method returns a boolean value true if all cased characters in the string are lowercase else for any other value it returns false.
Example 1
# Python program explaining
# the islower() method
# initializing the string value
strVal = "aagdhd"
# checking whether the passed string is in a lower case or not
result = strVal.islower()
# printing the islower() result
print("The islower() method returns: ",result)
Output
The islower() method returns: True
Example 2
# Python program explaining
# the islower() method
# initialising the string value
strVal = "REEMAisgoodgirl"
print("String 1:",strVal)
# validating if and else condition
if strVal.islower() == True:
print("All characters of specified string are in lower case.")
else:
print("All the characters are not in lower case.")
# passing another string
strVal1="reemaisgoodgirl"
print("String 2:",strVal1)
# again validating if and else condition
if strVal1.islower() == True:
print("All characters of specified string are in lower case.")
else:
print("All the characters are not in lower case.")
Output
String 1: REEMAisgoodgirl All the characters are not in lower case. String 2: reemaisgoodgirl All characters of specified string are in lower case.
