Use the islower()
method to check if the characters in a string are all in lower case.
text = 'This is a regular text'
print(text.islower())
#output: False
text = 'this is a regular text'
print(text.islower())
#output: True
text = 'this $ 1s @ a r3gular text!'
print(text.islower())
#output: True
If you notice the last example, the numbers and special characters like @
and $
in the string make no difference and islower()
still returns True
because the method only verifies the alphabetical characters.