[Fixed] No module named ‘pytest’

Quick Fix: Python raises the ImportError: No module named ‘pytest’ when it cannot find the library pytest. The most frequent source of this error is that you haven’t installed pytest explicitly with pip install pytest. Alternatively, you may have different Python versions on your computer, and pytest is not installed for the particular version you’re … Read more

(Fixed) No Module Named ‘Pip’ Error

Quick Fix: Python raises the ImportError: No module named ‘pip’ when it cannot find the library pip. The most frequent source of this error is that you haven’t installed pip. Alternatively, you may have different Python versions on your computer, and pip is not installed for the particular version you’re using. I have compiled the … Read more

PowerShell Operators

Windows PowerShell uses variables to store values, and we have a large set of operators we can use to modify or compare those variables. PowerShell Assignment Operators Assignment Operators allow us to simply create variables and populate them with values in one command: When we call those variables, we can see the values they contain: … Read more

Python __next__() Magic Method

Syntax object.__next__(self) The Python __next__ method returns an arbitrary element that represents the “next” element when you iterate over the object on which it is called. For example, if you iterate over my_object using for x in my_object, Python internally calls my_object.__next__() in each loop iteration to determine the next element. Formally, the __next__() method … Read more

Python __len__() Magic Method

Syntax object.__len__(self) The Python __len__ method returns a positive integer that represents the length of the object on which it is called. It implements the built-in len() function. For example, if you call len(x) an object x, Python internally calls x.__len__() to determine the length of object x. We call this a “Dunder Method” for … Read more

Create Web Frontend using Brownie react-mix

In this article, we continue exploring the functionality of Brownie, a smart contract development and testing framework for Solidity and Vyper. We created a simple smart contract in the previous tutorials and deployed it to the Ropsten testnet. Please check the following articles if you haven’t done so. Brownie – Smart Contracts in Python How … Read more

[FIXED] AttributeError: ‘NoneType’ object has no attribute ‘something’

Introduction Problem: How to solve “AttributeError: ‘NoneType’ object has no attribute ‘something’ “? An AttributeError is raised in Python when you attempt to call the attribute of an object whose type does not support the method. For example, attempting to utilize the append() method on a string returns an AttributeError as lists use the append() … Read more

Python Dijkstra Algorithm

You can download the PDF file of the presentation here. Also, watch the presentation as a Gif here: What is Dijkstra’s Algorithm? Dijkstra’s algorithm solves the single-source shortest path (SSSP) problem. Generally, it enables finding the shortest route between two vertices in a graph. Its author is dr. Edsger W. Dijkstra, a pioneering contributor to … Read more

Python Math Module – 5 Combinatorial Functions Ever Coder Ought to Know

This is the second article discussing the math module from the Python Standard Library. You can find the first about four basic numerical functions here. The articles are organized thematically; functions that are closely related to each other are discussed in the same article. In this article, we will explore two themes: combinatorics and elementary … Read more