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 Program to Check If a List is Empty
Python Program to Safely Create a Nested Directory
Python List copy()
Python String isalpha()
Java String Conversions
Python all()
Deep Learning with Python - Francois Cholletf
Python Program to Add Two Matrices
Python strftime()
Python Dictionary keys()
Python Strings
Python staticmethod()
Python Function Arguments
Python String istitle()
Python List insert()
Python Program to Add Two Numbers
Reading an HTTP Response Body as a String in Java
Python compile()
Python timestamp to datetime and vice-versa
Python String isupper()
Python Program to Find the Factorial of a Number
Python Set pop()
Python enumerate()
Python Program to Check the File Size
Python Anonymous / Lambda Function
Python Program to Check if a Number is Positive, Negative or 0
Python *args and **kwargs
String Processing with Apache Commons Lang 3
Python Package
APIs in Node.js vs Python - A Comparison
Python Program to Illustrate Different Set Operations
Python Program to Convert String to Datetime