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 bool()
Python Program to Get the Class Name of an Instance
Python hash()
Python String rfind()
Python next()
Python Artificial Intelligence Project for Beginners - Joshua Eckroth
Python Program to Return Multiple Values From a Function
Python String title()
Python Tuple count()
Python Dictionary update()
Python Program to Safely Create a Nested Directory
Python Get Current time
Python String rsplit()
Python Dictionary get()
Python Function Arguments
Python Program to Merge Two Dictionaries
Python chr()
Python String strip()
Python max()
Python Program to Access Index of a List Using for Loop
Python break and continue
Python Set intersection_update()
Python Program to Check Leap Year
Python *args and **kwargs
Python Program to Print Output Without a Newline
Reading an HTTP Response Body as a String in Java
JavaScript Eval: run a code string
Python Program to Convert Decimal to Binary Using Recursion
Map to String Conversion in Java
Python Deep Learning Cookbook - Indra den Bakker
Python String isidentifier()
Python abs()