Latest Posts From AskPython

Python String split() function

Python string split() functions enable the user to split the list of strings. It’s very useful when we are working with CSV data. String split() function syntax separator: It basically acts as a delimiter and splits the string at the specified separator value. maxsplit: It is a limit up to which the string can be […]

Python Sort List

The Python’s List sort() method sorts the elements in ascending/descending/user-defined order. Python Sort List The following are the various techniques to sort the elements: Sort the list in ascending order Sort the list in descending order Sort the list using user-defined order Sort a List of Objects Sorting of a list using a key 1. […]

Python Directory Operations

Directory is basically a structure that contains all the corresponding documents, files, and folders. Python’s os module contains multiple functions for directory management. Python directories functions os.access(path, mode)It uses the uid to check for the path’s access. os.chdir(path)It changes the CWD to the path specified by the user. os.chflags(path, flags)It is used to set the […]

Python String isnumeric() Function

Python String isnumeric() function returns True if all the characters in the input string are found to be of numeric type, else it returns False. A numeric character can be of the following type: numeric_character=Decimal numeric_character=Digit numeric_character=Numeric Syntax: isnumeric() arguments: The isnumeric() function dosen’t take any argument as input. Python isnumeric() Examples Example 1: Output: […]

Python getpass Module

Python getpass module enables to prompt the user for a password without displaying it on the screen. Thus, it will customize the user’s experience. It provides a secure and independent way of fetching the passwords from the command prompt. Python getpass Module Examples Import: Syntax: Simple Example: Output: 1. getpass module with no prompt 2. […]

Python pytz Module

Python pytz module serves the date-time conversion functionalities. Thus, enables users serving international client’s base. The pytz module enables time-zone calculations in our Python applications. Installation of pytz module: pip install pytz Python pytz Module Functions all_timezones all_timezones_set common_timezones common_timezones_set Fetching time of a given time-zone country_names country_timezones 1. all_timezones This function returns a list […]