Python String isalpha() Method
You are Here:
Python String isalpha()
The isalpha()
method checks whether all the characters of the string are Alphabets (a-z or A-Z) or not.
Note: This method does not allow numbers and special characters.
Example
Python Compiler
str1 = "python"
str2 = "123"
str3 = "PyThOn"
str4 = "python123"
print(str1.isalpha()) # True
print(str2.isalpha()) # False
print(str3.isalpha()) # True
print(str4.isalpha()) # False
Output
True
False
True
False
Syntax
txt.isalpha()
Parameter Values
It does not take any parameter.
Return Value
Value | Explanation |
---|---|
True | If the characters of the string contains only alphabets. |
False | If the characters of the string contains other than alphabets. |
Reminder
Hi Developers, we almost covered 90% of String functions and Interview Question on Python with examples for quick and easy learning.
We are working to cover every Single Concept in Python.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.