Tutorial Study Image

Python islower()

The islower() function in python helps to check whether all the alphabets in the string are lowercase. The function returns True if all the alphabets are lowercase. If it contains at least one uppercase letter then it will return False.


string.islower() 
 

islower() Parameters:

The islower() method doesn't take any parameters. The function will check only alphabet characters no numbers, symbols, and spaces are checked.

islower() Return Value

The return value is always a boolean value. If a given string contains only symbols or numbers this method will return false. The string that needs to be checked must contain at least one alphabet char.

Input Return Value
all lowercase alphabets True
at least one uppercase False

Examples of islower() method in Python

Example 1: How islower() method works in Python?


string = 'python programming'
print(string.islower())

string = 'python123 programming345'
print(string.islower())

string = 'Python programming'
print(string.islower())
 

Output:


True
True
False

Example 2: How to use islower() in a program in Python?


string = 'hi how are you?'
if string.islower() == True:
  print('All are lowercase letters.')
else:
  print('Contains uppercase letter.')
  
string = 'Hi how are you?'
if string.islower() == True:
  print('String does not contain uppercase letter.')
else:
  print('String Contains uppercase letter.')
 

Output:


All are lowercase letters.
String Contains uppercase letter.