Every character in the computer have the unique ASCII value so alphabet also have their ASCII value.
like Uppercase alphabet A to Z have 65 to 90
and lowercase 'a' to 'z' have 97 to 122
Program -
print("Enter Any character")
a=input()
#first way
if 65<=ord(a)<=90 or 97<=ord(a)<=122:
print("Yes it is alphabet")
else:
print("No it is not alphabet")
#second way
if a.isalpha():
print("Yes it is alphabet")
else:
print("No it is not alphabet")
Enter Any character
A
Yes it is alphabet
Yes it is alphabet
Enter Any character
r
Yes it is alphabet
Yes it is alphabet
Enter Any character
1
No it is not alphabet
No it is not alphabet
Enter Any character
@
No it is not alphabet
No it is not alphabet