There are several ways to check if a string contains any alphabet. You can use regular expression search() function or islower() or isupper() or isalpha() function. Check the following example:
Approach 1
>>> import re>>> str1='123456Hello'>>> if (re.search('[a-zA-Z]', str1)):... print ('Yes')... else:... print ('No')...Yes
Approach 2
First convert string to lowercase/uppercase() and then apply islower()/isupper().
>>> str1.lower().islower()True>>> str1.upper().isupper()True
Approach 3
Check each character in the string.
>>> any(c.isalpha() for c in str1)True