__new__ vs __init__ in Python

__new__ vs __init__ in Python

As a Python developer, working on a project for USA clients I came across two special methods __new__ and __init__. We will get into the specifics of __new__ and __init__, providing detailed explanations and examples to illustrate their use. __new__ and __init__ in Python In Python, object-oriented programming (OOP) revolves around classes and objects. When … Read more >>

How to Implement the Sigmoid Activation Function in Python?

Sigmoid Activation Function in Python

In this tutorial, I will explain how to implement the sigmoid activation function in Python. As a Python developer, I came across a scenario where I needed to use the sigmoid function and I explored more about the sigmoid function. Let us learn more about this topic today. Sigmoid() Function in Python The sigmoid or … Read more >>

How to Use the insert() Function in Python?

insert() Function in Python

In this tutorial, I will explain how to use the insert() function in Python. As a Python developer, while working on a project for New York clients, I came across a scenario where I needed to use the insert() and I explored more about the insert() function. Let us learn more about this topic today. … Read more >>

How to Use the arange() Function in Python?

arange() Function in Python

In this tutorial, I will explain how to use the arange() Function in Python. As a Python developer, while working on a project for New York clients, I came across a scenario where I needed to use arange() and I explored more about arange() function. Let us learn more about this topic today. arange() Function … Read more >>

Python pass Statement: Stubs, Empty Blocks and Loops

Python pass statement: Command Prompt output of stub functions, a custom exception class and an if branch that use pass

The Python pass statement does nothing. It’s a placeholder you put where Python needs a statement but you have no code yet, like an empty function, class, loop or if branch. People often call it the pass function, but it’s a keyword: Each snippet here got tested with Python 3.12.5 inside a Windows Command Prompt, … Read more >>

How to Use the trim() Function in Python?

trim() Function in Python

In this tutorial, I will explain how to use the trim function in Python to clean up your strings. As a Python developer, while working on a project for a USA client, I often came across a situation where I needed to use the trim() function and explored various use cases of the trim() function. … Read more >>

How to Use the strip() Function in Python?

strip() Function in Python

In this tutorial, I will explain how to use the strip() function in Python. As a Python developer, while working on a project for a New York client, I encountered a situation where I needed to use the split() function and explored various uses of the split() function. Let us learn more about this topic … Read more >>

How to Implement and Use the hash() Functions in Python?

hash() Functions in Python

In this tutorial, I will explain how to implement and use hash() functions in Python. One of my team members asked this question and I decided to write a tutorial on this topic. Let us learn the implementation with examples and screenshots of the executed example code. hash() Function in Python A hash() function takes … Read more >>

How to Use the map() Function in Python

Python map() function: Command Prompt output of map() with a lambda over two lists

The Python map() function calls a function on every item of an iterable and gives you the results one at a time. Write map(function, iterable), then wrap it in list() when you want a list back: For the record, I tested these snippets with Python 3.12.5 (and Python 3.14.8 for the newer strict= keyword) on … Read more >>