Python Islower String Method

preview_player
Показать описание
Be sure to like, share and comment to show your support for our tutorials.

=======================================
======================================
Python Islower String Method
In this Python tutorial we will explore the Python islower string method. The islower string method checks the string object to ensure that all characters are lowercase characters. If the string object contains all lowercase characters Python will return True. If the string object contains an uppercase character or characters then Python will return False.

Python Islower String Method Syntax

'String Object'.islower()

'String Object' - This is our string object that will be examined by the islower string method.
.islower() - This is our string method islower() that checks if all characters in a string object are lowercase if they are then Python returns True and if the string object contains one or more uppercase characters than Python returns False.
Examples Of The Islower String Method
#Example 1
'islower string method'.islower()
True

#Example 2
'Islower string method'.islower()
False

#Example 3
a = 'this is a string'
True
Examples Explained

Example 1:

'islower string method'.islower() - We create a string object with all lowercase characters and call our islower string method on our string object.

True- We are returned True since our string object contains only lowercase characters.

Example 2:

'Islower string method'.islower() - We create another string object and this time we make the 'i' uppercase. Then we call our islower string method on the string object.

False- We are returned False since the string object contains a uppercase letter.

Example 3:

a = 'this is a string'- We create a new string object and assign the variable 'a' to represent the string object.

True- We are returned True because all characters are lowercase in the string object.
Conclusion

In this Python tutorial we took a look at the Python islower string method which will check a string object and return True if the characters contained in the string are all lowercase if not then Python will return False.

If you have any questions about the islower string method leave a comment below and we will help you out.
Рекомендации по теме
Комментарии
Автор

Short, but helpful videos on these methods. Thanks.

JJJJ-gluf