Python

Generate QR Code Using Python

Generating QR codes is super easy using Python. We will see how we can generate them using such a small amount of code in Python. To do that, we first have to install a Python package. It is named qrcode. To install it: pip install qrcode Then, just write the following code: The above code […]

Let’s Create a Calculator Using Python

We all know about calculators and what it does. This blog is about creating a basic calculator using Python. If you are a beginner, this might help you. This calculator will have only four basic arithmetic operations. Those are addition, subtraction, multiplication, and division. We are all familiar with these. This calculator concept is simple.

Write Rock Paper Scissors Game Using Python

Rock Paper Scissors is a pretty well-known game. I assume that you know about it and its rule. In this blog, we are going to build this game using Python. Nothing fancy. There must be two players to play this game. So, in this case, one will be the computer, and the other will be

LeetCode 226 | Invert Binary Tree | Python | Solution

Invert Binary Tree is one of the most popular programming problems. It’s an easy problem. I assume that you have a basic understanding of Binary Tree and Recursion. LeetCode 226 The problem description is straightforward. Simply put, we have to invert a binary tree and then return the root. More precisely, to solve this, we

LeetCode 199 | Binary Tree Right Side View | Python | Solution

If you know about the level order traversal algorithm, finding the right-side view of a binary tree becomes easy for you. This problem is nothing but a simple extended version of that. If you want to know about Level Order Traversal, I will encourage you to read this blog. LeetCode 199 The problem description is

Number of 1 Bits | LeetCode 191 | Python | Solution

To solve this ‘number of 1 bits‘ problem, we have to count the number of ‘1’ bits from an unsigned integer. It’s an easy problem if you know about bit manipulation. Let’s see how we can solve it. LeetCode 191 Mainly we will use ‘>>‘ (shift right) to solve this problem. Shift right is one

Max Area of Island | LeetCode 695 | Python | Solution

‘Max Area of Island’ is a graph problem. I assume you already have a basic understanding of Graph and DFS algorithms. This problem is almost similar to the number of islands problem. I wrote about it in my blog. LeetCode 695 Problem Overview (Max Area of Island) Before getting into the problem, read the description

Recursion | An Awesome Method for Solving Problems

Before getting into details, you don’t need to be disappointed if you don’t understand the recursion quickly. Initially, it may seem a bit complex or fuzzy to you. But don’t worry, it still seems vague to me. That’s why I will try to write on this topic to make it a little clearer to myself.

Overview of Python Dictionary | Data Structure

Dictionary in Python is a data structure. Dictionary is similar to HashTable with some extra features. HashTable is one of the most important data structures in computer science. You can use a dictionary as a HashTable. HashTable is excellent in terms of time complexity and easy data access. We can access, add, update, and delete

Number of Islands | LeetCode 200 | Python | Solution

LeetCode 200 The number of islands is one of the most popular programming problems. Read the problem description first. Before getting into the solution, I assume you already know about the DFS algorithm. We will use this algorithm to solve this problem. The four edges and ‘0’s will be counted as water in the given

Scroll to Top