is alpha:
- In python "is alpha" is the method used to check the alphabets whether they are present in the given string or substring.
- In isalpha, it must carry only alphabets.
- It carries the result in the boolean type
- If the string contains all alphabets then it returns true, else false.
- The isalpha is not applicable for the alphanumeric.
- It is the built-in function of python.
syntax: str.isalpha()
Example: s="abcdefg"
str.isalpha(s)
true
#write a python program to demonstrate is alpha function.
- a="india"
- b="india123"
- a=str.isalpha(a)
- b=str.isalpha(b)
- print(a)
- print(b)
output: true
false
No comments