Answers for "python check if only letters in string"

4

python check if character is letter

>>> 'A'.isalpha()
True
>>> '1'.isalpha()
False
Posted by: Guest on October-19-2020
0

how to check if a string is composed only of alphabets in python

str1 = "hello world. welcome to python examples."

bool = str1.isalpha()

print('str1 contains only alphabets:', bool)
//output will be False
Posted by: Guest on October-11-2020
0

python check if input contains letters

re.search('[a-zA-Z]', the_string)
Posted by: Guest on September-23-2021

Code answers related to "python check if only letters in string"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language