Python String islower() Method

The islower() method checks whether all the characters of a given string are lowercased or not. It returns True if all characters are lowercased and False even if one character is uppercase.

It returns False if a string contains only symblos and numbers, but returns True if symbols or numbers are with lower case string.

Syntax:

str.islower()

Parameters:

None

Return Value:

Returns True if lowercased, else False.

The following eample checks whether the given string is in lowercase or not.

Example:
>>> mystr = 'hello world'
>>> mystr.islower()
True
>>> mystr = 'Hello world'
>>> mystr.islower()
False
>>> mystr = 'python is #1'
>>> mystr.islower()
True

The islower() method always returns false if a given string contains only symbols or numbers but not alphabats.

Example:
>>> mystr='#1?><~()+=*-+./\[]'
>>> mystr.islower()
False

A string must contain at least one alphabat char.

Example:
>>> mystr='#1?><~()+=*-+./\[] this is lower'
>>> mystr.islower()
True
>>> mystr='#1?><~()+=*-+./\[] THIS IS UPPER'
>>> mystr.islower()
False