In this source code example, we will demonstrate how to use the Python string islower() method to check if all case characters are lowercase.
The following example returns False because the string has no cased characters:
Python
Python String
Use the Python string islower() method to determine if all cased characters of a string are lowercase.
However, the following example returns False because the first character of the string is uppercase:
Python string islower() method example
The following example uses the islower() to check if all characters of an email are lowercase:email = 'hello@example.com'
is_lowercase = email.islower()
print(is_lowercase)
Output:
True
email = 'Hello@example.com'
is_lowercase = email.islower()
print(is_lowercase)
Output:
False
email = '123@123'
is_lowercase = email.islower()
print(is_lowercase)
Output:
False
Related Python String Examples
- Python string literals
- Python string length example
- Python String join() method example
- Python string split() method example
- Python String index() method example
- Python string find() method example
- Python string startswith() method example
- Python string endswith() method example
- Python String lower() method example
- Python String upper() method example
- Python string title() method example
- Python string capitalize() method example
- Python string islower() method example
- Python string istitle() method example
- Python string isupper() method example
- Python string swapcase() method example
- Python string strip() method example
- Python string replace() method example
- Python string isdigit() method example
- Python string isdecimal() method example
- Python string isnumeric() method example
- Python string isalpha() method example
- Python string isalnum() method example
Comments
Post a Comment