how to check if a string contains a letter python code example
Example 1: check if string contains alphabets python
import re
print(re.search('[a-zA-Z]', "anything"))
Example 2: check if string contains python
>>> str = "Messi is the best soccer player"
>>> "soccer" in str
True
>>> "football" in str
False