Python string islower() method

Python String islower() Method

Description

The islower() method checks whether all case-sensitive characters (letters) in a string are lowercase.

Syntax

The following is the syntax of the islower() method:

var.islower()

Parameters

None

Return Value

This method returns True if all case-sensitive characters in the string are lowercase and there is at least one case-sensitive character; otherwise, it returns False.

Example

The following example demonstrates the use of the islower() method.

var = "explicit is better than implicit."
var1 = var.islower()
print ("Raw string:", var)
print ("Does it contain only lowercase letters?:", var1)

var = "Are you ok?"
var2 = var.islower()
print ("Raw string:", var)
print ("Does it contain only lowercase letters?:", var2)

var = "αβθ"
var3 = var.islower()
print ("Raw string:", var)
print ("Does it contain only lowercase letters?:", var3)

When you run this program, it will produce the following output −

Raw string: explicit is better than implicit.
Does it contain only lowercase letters? : True
Original string: Are you ok?
Does it contain only lowercase letters? : True
Original string: αβθ
Does it contain only lowercase letters? : True

Leave a Reply

Your email address will not be published. Required fields are marked *