Skip to content
Tutorials Center
My learning

Topics

Python Reference Β· String Methods

Python str.islower() method

Reference for Python str.islower(): test whether all cased characters are lower case, how digits and punctuation are ignored, and how it differs from lower().

The islower() method returns True if the string contains at least one cased character and every cased character is lower case. Characters that have no case, such as digits, spaces and punctuation, are ignored, so "hello world!" and "abc123" both count as lower case.

It is a test, not a conversion. To change the case of a string, use lower().

Python
print("python".islower())   # True
print("Python".islower())   # False

Try it

Python Cased and uncased characters

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Python Checking before converting

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Syntax

Python
str.islower()

This method takes no parameters.

Return value: True if the string has at least one cased character and no upper-case or title-case characters; otherwise False.

Raises: nothing.

Usage notes

  • Needs at least one letter. "123".islower() and "".islower() are False because there is no cased character to be lower case.
  • Not the opposite of isupper(). A string can be neither: "Hello" is not lower case and not upper case, and "123" is neither too. Do not write not s.isupper() when you mean s.islower().
  • One capital ruins it. A single upper-case or title-case character makes the result False, wherever it appears.
  • Unicode aware. Letters from other alphabets with case, like "Γ€" or "ΠΆ", are handled. Scripts without case, such as Chinese, are ignored like digits.
  • Case-insensitive comparison. Use casefold() rather than testing with islower() when comparing text.
  • Bytes. bytes.islower() exists and considers only ASCII letters.