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:
Deep Learning with Python - Francois Cholletf
Python Dictionary update()
Python Program to Trim Whitespace From a String
Python Program to Display Powers of 2 Using Anonymous Function
Deep Learning from Scratch - Building with Python form First Principles - Seth Weidman
Python Dictionary fromkeys()
Python Program to Parse a String to a Float or Int
Reading an HTTP Response Body as a String in Java
Python List copy()
Python Program to Merge Two Dictionaries
Python Program to Count the Occurrence of an Item in a List
Java InputStream to String
Python Set symmetric_difference_update()
Python Set symmetric_difference()
Python Program to Convert Celsius To Fahrenheit
String Initialization in Java
Python String isalpha()
Python locals()
Java – String to Reader
Python Program to Print Colored Text to the Terminal
Python Program to Randomly Select an Element From the List
Python del Statement
Python Program to Count the Number of Occurrence of a Character in String
Python reversed()
Python round()
Python Operator Overloading
Python String find()
Statistical Methods for Machine Learning - Disconver how to Transform data into Knowledge with Pytho...
Python String center()
Python setattr()
Python Matrices and NumPy Arrays
Python Program to Return Multiple Values From a Function