LAST UPDATED: JUNE 9, 2020
Python String islower()
The Python islower()
string method returns true if all characters of a string are in lowercase, else returns false.
-
The islower()
method is an in-built method for string handling.
-
If all case-based characters (letters) of a string are in lowercase then this method returns true otherwise returns false.
-
This method returns true for whitespace if all other characters in the given string are alphabet and in lowercase. For a string with only whitespaces, this method will return false.
-
For digits and symbols, this method returns false
.
Python String islower()
: Syntax
Below we have a basic syntax of the islower()
method in Python:
string.islower()
Note: In the above syntax string denotes the string variable on which islower()
method will be applied.
Python String islower()
: Parameters
From the syntax it is clear that this method does not take any parameters. If any parameter will be passed then it will raise an error.
Python String islower()
: Returned Values
This method returns true if all characters of a string are in lowercase and false otherwise.
Python String islower()
: Basic Example
Below we have an example to show the working of String islower()
function:
str="i Am Girl"
print(str.islower())
The Output will be:
false
Note: The above example's output is false because all letters are not in lowercase.
Another Example
str="i am a wonderwoman"
print(str.islower())
The Output will be:
true
Time for a Live Example!
Now let us take a look at Live example where we will use the islower()
method:
Summary
This tutorial covers the islower()
method of strings in Python which returns true
if all characters of a string are in lowercase. It returns false
for digits, symbols, and whitespaces.