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 float()
Python Program to Merge Mails
Python Program to Extract Extension From the File Name
How to get current date and time in Python?
Python Program to Slice Lists
Python Iterators
Python List Comprehension
Python Directory and Files Management
Python reversed()
Python Program to Convert Bytes to a String
String Set Queries
APIs in Node.js vs Python - A Comparison
Python Strings
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Python Program to Sort a Dictionary by Value
JavaScript Eval: run a code string
Python abs()
Python Program to Get the Last Element of the List
JavaScript Methods of RegExp and String
Python Program to Check Whether a String is Palindrome or Not
Python Program to Split a List Into Evenly Sized Chunks
Python String maketrans()
Converting String to Stream of chars
Python bytes()
Python Deep Learning - Valentino Zocca & Gianmario Spacagna & Daniel Slater & Peter Roelants
Building Machine Learning Systems with Python - Willi Richert & Luis Pedro Coelho
Python issubclass()
Python bytearray()
Python String endswith()
Python Set add()
Python __import__()
Python tuple()