Pankaj Kumar

Pankaj Kumar

I have been working on Python programming for more than 12 years. At AskPython, I share my learning on Python with other fellow developers.
isalpha in Python: String Letter Check

isalpha in Python: String Letter Check

When you check whether a text value contains only letters, you need a clear rule for every character in it. Python’s isalpha() method returns True when a nonempty string consists entirely of Unicode letters. This article shows how to call…

Python String isalnum() Function

Python String isalnum() Function

Choosing a test for a Python string starts with deciding which characters it may contain. Python’s str.isalnum() returns True when a nonempty string contains only alphabetic or numeric characters. I’ll show how to test a complete string with str.isalnum() and…