English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Python basic tutorial

Python flow control

Python Functions

Python Data Types

Python file operations

Python objects and classes

Python date and time

Advanced knowledge of Python

Python reference manual

Python string islower() usage and example

Python string methods

If all the letters in the string are lowercase letters, the islower() method returns True. If the string contains at least one uppercase letter, it returns False.

The syntax of islower() is:

string.islower()

islower() parameters

islower() method does not take any parameters.

islower() return value

islower() method returns:

  • True if all the letters in the string are lowercase letters.

  • False if the string contains at least one uppercase letter.

Example1From islower() return value

s = 'this is good'
print(s.islower())
s = 'th!s is a'1so g00d
print(s.islower())
s = 'this is Not good'
print(s.islower())

When running the program, the output is:

True
True
False

Example2How to use islower() in the program?

s = 'this is good'
if s.islower() == True:
  print('Does not contain uppercase letters.')
else:
  print('Contains uppercase letters.')
  
s = 'this is Good'
if s.islower() == True:
  print('Does not contain uppercase letters.')
else:
  print('Contains uppercase letters.')

When running the program, the output is:

Does not contain uppercase letters.
Contains uppercase letters.

Python string methods