English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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() method does not take any parameters.
islower() method returns:
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())
When running the program, the output 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.')
When running the program, the output is:
Does not contain uppercase letters. Contains uppercase letters.