Program to calculate LCM of two numbers

Let’s understand the various methods to write a Python program to calculate LCM of two numbers. What is LCM? LCM means Lowest Common Multiple. The LCM of two numbers is the smallest number which is a common multiple of both the numbers. The LCM is atleast equal to the larger of the two numbers. As... » read more

Program to calculate HCF of two numbers

Let’s understand the various methods to write a Python program to calculate HCF of two numbers. What is HCF? HCF means Highest Common Factor. The HCF of two numbers is the largest number which can exactly divide both the numbers. The HCF is at most equal to the smaller of the two numbers. As an... » read more

Program to calculate factorial of a number

Let’s understand the different ways to write a Python program to calculate factorial of a number. What is factorial of a number? The factorial of a given number (N) is defined as the product obtained by multiplying all the numbers between the given number (N) and 1. For example, the factorial of 5 is the... » read more

Program to find the distance between two points

A point identified by the co-ordinates X1,Y1 is at a distance from the point identified by the co-ordinates X2,Y2. Let’s write a Python program to find the distance between two points. How to find the distance between two points? The distance between two points (X1,Y1) and (X2,Y2) can be calculated using the formula given below.... » read more

Program to find the quadrant of a point

A point identified by the co-ordinates x,y is in one of the four quadrants of the co-ordinate system. Let’s write a Python program to find the quadrant of a point specified by x,y. How many quadrants are there in a plane? There are 4 quadrants in a plane in the co-ordinate system. A point x,y... » read more

Program to generate factors of a number

Let’s write a Python program to generate factors of a number. What are factors of a number? The factors of a number are those numbers which can divide the given number exactly. A number when divided by its factor yields a zero remainder. Some examples are given below. Each number has atleast two factors, 1... » read more

Program to generate Fibonacci Series
Program to generate Fibonacci Series

Let’s write a Python program to generate Fibonacci series. We will also write a program to generate the prime numbers in a Fibonacci series. What is a Fibonacci series? The Fibonacci Series is a series of numbers in which the first number is 0 and the second number is 1. The third number is the... » read more

Program to check if number is Prime
Program to check if number is Prime

Let’s write a Python program to check if number is prime or not. What is a Prime number? A number which is not divisible by any number except 1 and itself is called as a prime number. A prime number has only two factors, 1 and itself. How to check if number is prime? To... » read more