Vijaykrishna Ram

Vijaykrishna Ram

Queue in Python: Create and Use Queues

Queue in Python: Create and Use Queues

As you build a Python program that processes items in sequence, a queue holds them until they are retrieved. Python’s queue module includes synchronized FIFO queues, while collections.deque provides a basic FIFO container. I’ll explain how to create a queue…

Filter Function in Python

Filter Function in Python

When a list of records includes entries that pass a condition and entries that do not, selecting the matches calls for a test. Python’s filter() applies a test, called a predicate, to each item and returns an iterator containing the…

Args and Kwargs in Python

Args and Kwargs in Python

As a function grows, callers may need to supply values beyond its named parameters. In Python, *args collects extra positional arguments into a tuple, while **kwargs collects extra keyword arguments into a dictionary. This article explains how to collect and…

The pickle Module in Python

The pickle Module in Python

A value created in one Python run may still be useful after that run ends. Python’s pickle module turns an object into bytes that Python can reconstruct. I’ll show how to save and restore a Python value with pickle, then…