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 String isalnum()
Python Program to Create Pyramid Patterns
Python Machine Learning - Sebastian Raschka
Python Program to Delete an Element From a Dictionary
Python String isupper()
Python ord()
Python list()
Python Program to Catch Multiple Exceptions in One Line
Python issubclass()
Python round()
Python Recursion
Format ZonedDateTime to String
Python Program to Create a Countdown Timer
Python String replace()
Python Inheritance
Python List reverse()
Python Program to Count the Number of Digits Present In a Number
Python Program to Copy a File
Python String isnumeric()
Python Program to Iterate Over Dictionaries Using for Loop
Python Program to Shuffle Deck of Cards
Python Program to Find LCM
Python String index()
Python Program to Reverse a Number
Python vars()
Java – String to Reader
Python Program to Find Numbers Divisible by Another Number
Python Program to Print Output Without a Newline
Python Program to Illustrate Different Set Operations
Python String find()
Python time Module
Python String casefold()