You can use islower() in your string to see if it contains several lowercase letters (among other characters). or using isupper() to also check if some uppercase letters contain:
below: letters in a string: test returns true
>>> z = "(555) 555 - 5555 ext. 5555" >>> z.isupper() or z.islower() True
below: there are no letters in the line: test returns false.
>>> z= "(555).555-5555" >>> z.isupper() or z.islower() False >>>
Not to be confused with isalpha() which returns True only if all characters are letters, and this is not what you need.
Please note that Barma’s answer complements mine well, as mine does poorly with the mixed case.
Jean-François Fabre Mar 24 '17 at 15:08 2017-03-24 15:08
source share