Table of Contents
The islower() method returns True if all alphabets in a string are lowercase alphabets. If the string contains at least one uppercase alphabet, it returns False.
The syntax of islower() is:
string.islower()
1. islower() parameters
The islower() method doesn’t take any parameters.
2. Return Value from islower()
The islower() method returns:
- True if all alphabets that exist in the string are lowercase alphabets.
- False if the string contains at least one uppercase alphabet.
3. Example 1: Return Value from islower()
s = 'this is good' print(s.islower()) s = 'th!s is a1so g00d' print(s.islower()) s = 'this is Not good' print(s.islower())
Output
True True False
4. Example 2: How to use islower() in a program?
s = 'this is good'
if s.islower() == True:
print('Does not contain uppercase letter.')
else:
print('Contains uppercase letter.')
s = 'this is Good'
if s.islower() == True:
print('Does not contain uppercase letter.')
else:
print('Contains uppercase letter.')
Output
Does not contain uppercase letter. Contains uppercase letter.
Related posts:
Python bytearray()
Python String splitlines()
Python Program to Split a List Into Evenly Sized Chunks
Python open()
Python Machine Learning Third Edition - Sebastian Raschka & Vahid Mirjalili
Python format()
Python hex()
Python String lstrip()
Python Inheritance
Python Machine Learning - Sebastian Raschka
Python filter()
Python Dictionary keys()
Python Program to Shuffle Deck of Cards
Python Program to Make a Flattened List from Nested List
Python Dictionary copy()
Python RegEx
Python String rstrip()
Python Dictionary setdefault()
Learning scikit-learn Machine Learning in Python - Raul Garreta & Guillermo Moncecchi
Python memoryview()
Python Operator Overloading
Python Set difference()
Python List index()
Python Artificial Intelligence Project for Beginners - Joshua Eckroth
Python list()
Python Program to Merge Two Dictionaries
Split a String in Java
Python Program to Convert Kilometers to Miles
Python compile()
Python Custom Exceptions
Python Multiple Inheritance
Python String split()