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 Set symmetric_difference_update()
Python List append()
Python String replace()
Python Program to Compute the Power of a Number
How to Remove the Last Character of a String?
String Set Queries
Python Program to Print the Fibonacci sequence
Python String find()
Python tuple()
Python zip()
Java – String to Reader
Python String format_map()
Python Set update()
Python Program to Display the multiplication Table
Python Set copy()
Python List count()
Python any()
Python Dictionary copy()
Python list()
Python Program to Count the Number of Digits Present In a Number
Python Program to Get the File Name From the File Path
Python type()
Python Global Keyword
Python Program to Check Armstrong Number
Python Program to Remove Duplicate Element From a List
Python Program to Convert Bytes to a String
Python Strings
Python Objects and Classes
Machine Learning Applications Using Python - Cases studies form Healthcare, Retail, and Finance - Pu...
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Convert String to int or Integer in Java
Python String rjust()