English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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()
The islower() method does not take any parameters.
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.
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
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.