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 lstrip()
Python List
Python Program to Delete an Element From a Dictionary
Python Set issubset()
Python Set discard()
Python Set copy()
Python id()
APIs in Node.js vs Python - A Comparison
Python Namespace and Scope
Python getattr()
Python String expandtabs()
Array to String Conversions
Python Program to Find the Size (Resolution) of a Image
Python Custom Exceptions
Python oct()
Python Deep Learning Cookbook - Indra den Bakker
Python String split()
Python Exception Handling Using try, except and finally statement
Python dict()
Python Program to Randomly Select an Element From the List
Jackson – Marshall String to JsonNode
Python Program to Check if a Number is Positive, Negative or 0
Python Tuple
Python Program to Find Sum of Natural Numbers Using Recursion
Python all()
Python Program to Get a Substring of a String
Applied Text Analysis with Python - Benjamin Benfort & Rebecca Bibro & Tony Ojeda
Python Dictionary values()
Python String splitlines()
Python Dictionary pop()
Python Program to Copy a File
Python Dictionary fromkeys()