Articles on Trending Technologies

Technical articles with clear explanations and examples

Python Program for n-th Fibonacci number

Pavitra
Pavitra
Updated on 25-Mar-2026 1K+ Views

In this article, we will compute the nth Fibonacci number using different approaches in Python. A Fibonacci number is defined by the recurrence relation given below − Fn = Fn-1 + Fn-2 With F0 = 0 and F1 = 1. The first few Fibonacci numbers are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... We can compute the Fibonacci numbers using recursion and dynamic programming methods. Let's explore both approaches with their implementations. Using Recursion Method The recursive approach directly implements the mathematical ...

Read More

Python Program for nth Catalan Number

Pavitra
Pavitra
Updated on 25-Mar-2026 657 Views

In this article, we will learn about calculating the nth Catalan number using different approaches in Python. Catalan numbers are a sequence of natural numbers that occur in various combinatorial problems. They are defined by the recursive formula: C₀ = 1 and Cₙ₊₁ = Σᵢ₌₀ⁿ CᵢCₙ₋ᵢ for n ≥ 0 The first few Catalan numbers for n = 0, 1, 2, 3, ... are 1, 1, 2, 5, 14, 42, 132, 429, ... Catalan numbers can be calculated using recursion or dynamic programming. Let's explore both implementations. Approach 1: Recursive Method The recursive approach directly implements the mathematical definition ? # A recursive solution def catalan(n): # Base case if n

Read More

Python Program for How to check if a given number is a Fibonacci number?

Pavitra
Pavitra
Updated on 25-Mar-2026 681 Views

In this article, we will learn how to check if a given number is a Fibonacci number using a mathematical property rather than generating the entire Fibonacci sequence. Problem Statement Given a number n, we need to determine whether n is a Fibonacci number or not. The Fibonacci sequence starts with 0 and 1, where each subsequent number is the sum of the previous two numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ... Mathematical Property A number is Fibonacci if and only if (5*n² + 4) or (5*n² - 4) is ...

Read More

Python Program for GCD of more than two (or array) numbers

Pavitra
Pavitra
Updated on 25-Mar-2026 1K+ Views

In this article, we will learn how to find the Greatest Common Divisor (GCD) of more than two numbers or an array of numbers using Python. Problem statement − Given an array of numbers, we need to find the greatest common divisor of all elements. The GCD of multiple numbers can be calculated by repeatedly finding the GCD of pairs of numbers. We start with the first two numbers, find their GCD, then find the GCD of that result with the third number, and so on. Algorithm The approach involves: Implement a function to find ...

Read More

Python Program for the focal length of a spherical mirror

Pavitra
Pavitra
Updated on 25-Mar-2026 486 Views

In this article, we will learn about calculating the focal length of a spherical mirror using Python. We'll explore both concave and convex mirrors with their respective formulas. Problem Statement We are given the radius of curvature of a spherical mirror and need to find its focal length. The focal length is the distance between the center of curvature of the mirror to the principal focus. To determine the focal length of a spherical mirror, we need to know its radius of curvature − the distance from the vertex of the mirror to the center of curvature. ...

Read More

Python Program for Finding the vertex, focus and directrix of a parabola

Pavitra
Pavitra
Updated on 25-Mar-2026 1K+ Views

In this article, we will learn how to find the vertex, focus, and directrix of a parabola given its equation in standard form y = ax² + bx + c. Problem Statement Given a parabola equation in the standard form y = ax² + bx + c, we need to find: Vertex: The point where the parabola changes direction Focus: A fixed point inside the parabola Directrix: A fixed line outside the parabola ...

Read More

Python Program for Find the perimeter of a cylinder

Pavitra
Pavitra
Updated on 25-Mar-2026 212 Views

In this article, we will learn how to calculate the perimeter of a cylinder using Python. The perimeter represents the outline of the cylinder when viewed from the side. Understanding Cylinder Perimeter When we view a cylinder from the side, it appears as a rectangle. The perimeter is the total distance around this rectangular outline. diameter (d) height (h) ...

Read More

Windows 10 Toast Notifications with Python

Pavitra
Pavitra
Updated on 25-Mar-2026 1K+ Views

We can create toast notifications for Windows 10 events using Python. This is very simple with the win10toast module. If you are familiar with Toast notifications in Android, then understanding toast notifications with Python is straightforward. We can generate notifications whenever an event occurs as a reminder. Installation Run the following command in command-line to install the win10toast module ? pip install win10toast If the module is successfully installed, you will get output similar to this ? Collecting win10toast Downloading https://files.pythonhosted.org/packages/d4/ba/95c0ea87d9bcad68b90d8cb130a313b939c88d8338a2fed7c11eaee972fe/win10toast-0.9-py2.py3-none-any.whl Collecting pypiwin32 (from win10toast) Installing collected packages: pypiwin32, win10toast Successfully installed ...

Read More

What are the tools to support Data Science other than Python and R?

Pavitra
Pavitra
Updated on 25-Mar-2026 192 Views

While Python and R dominate data science, numerous other powerful tools exist for data processing, storage, analysis, and machine learning. These tools complement programming languages and provide specialized capabilities for handling big data, distributed computing, and enterprise-scale analytics. Apache Hadoop Apache Hadoop is a Java-based open-source framework designed for distributed storage and processing of large datasets across clusters of computers. Key Features Distributed Storage − Uses Hadoop Distributed File System (HDFS) to store data across multiple nodes Fault Tolerance − Automatically handles hardware failures by replicating data Scalability − Can scale from single servers to ...

Read More

K'th Non-repeating Character in Python using List Comprehension and OrderedDict

Pavitra
Pavitra
Updated on 25-Mar-2026 430 Views

In this article, we will learn how to find the K'th non-repeating character in a string using Python's List Comprehension and OrderedDict. This approach maintains the order of first occurrence while efficiently counting character frequencies. Algorithm The algorithm follows these steps: 1. Create an OrderedDict from the input string to maintain insertion order 2. Count the frequency of each character by iterating through the string 3. Extract all characters that appear exactly once using list comprehension 4. Return the (k-1)th element from the non-repeating characters list Example Let's implement the solution to find ...

Read More
Showing 7021–7030 of 61,297 articles
« Prev 1 701 702 703 704 705 6130 Next »
Advertisements