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 Program to Count the Occurrence of an Item in a List
Python Set clear()
Python enumerate()
Python String isalpha()
Python Program to Catch Multiple Exceptions in One Line
Python Iterators
Python timestamp to datetime and vice-versa
Python Anonymous / Lambda Function
Python Dictionary items()
Python sorted()
Python Program to Check If Two Strings are Anagram
Python List remove()
Python Program to Get a Substring of a String
Check if a String is a Palindrome in Java
Python super()
Python Program to Check if a Number is Odd or Even
Python complex()
Python String index()
Python iter()
Python Tuple
Python Program to Convert Kilometers to Miles
Python Program to Compute the Power of a Number
Python Program to Slice Lists
Python String title()
Python 3 for Absolute Beginners - Tim Hall & J.P Stacey
Python property()
Case-Insensitive String Matching in Java
Python List Comprehension
Converting a Stack Trace to a String in Java
Python String capitalize()
String Initialization in Java
Python callable()