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…

Python str.upper() Method: Syntax and Examples

Python str.upper() Method: Syntax and Examples

Converting a Python string to uppercase gives it an uppercase form. Python’s str.upper() method returns a copy of a string with its cased characters converted to uppercase. I’ll show how to call str.upper() and what happens to the original string…

Weather API Python: Analyze Historical Trends

Weather API Python: Analyze Historical Trends

Historical weather records can help answer how conditions varied during a chosen period. A weather API returns data for a requested location and time span, which Python can use to calculate summaries. This article shows how to send a historical…

OS mkdir: Create Directories in Python

OS mkdir: Create Directories in Python

A program may need a directory at a particular filesystem path. Python’s directory-creation calls let you create one directory or create missing parent folders along the path. This article explains the os mkdir operation and shows how os.mkdir() and os.makedirs()…