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

Python basic tutorial

Python flow control

Fonction en Python

Types de données en Python

Python file operations

Python objects and classes

Python date and time

Advanced Python knowledge

Python reference manual

Python string islower() usage and example

Python string methods

If all the letters in the string are lowercase, 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

The islower() method does not take any parameters.

The return value of islower()

The return value of islower() method

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

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

Example1From the return value of islower()

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())

The output when running the program is:

True
True
False

Example2How to use islower() in a 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.')

The output when running the program is:

Does not contain uppercase letters.
Contains uppercase letters.

Python string methods