check if letter is in word python code example
Example 1: python check if character is letter
>>> 'A'.isalpha()
True
>>> '1'.isalpha()
False
Example 2: how to check if a string contains a word python
if word in mystring:
print('success')
>>> 'A'.isalpha()
True
>>> '1'.isalpha()
False
if word in mystring:
print('success')