Perform right rotation by n on array (list) in Python

Python program to perform right rotation of array (list) elements by n positions

In this tutorial, we will learn to create an array (list in case of python) and rotate the elements stored in the array (list) by ‘n’ positions. The value of ‘n’ is also taken input by the user.  That means if our array (list) is: After the user inputs the rotation value 3, then the … Read more

Check character is digit using ‘isdigit()’ in Python

Check character is digit using 'isdigit()'

In this tutorial we are going to check if the character is Digit ( 0-9) or not using isdigit() function in python. Problem statement For the any input character we have to check character is digit or not. For example: Our logic to check given character is digit or not using ‘isdigit()’ function Algorithm to … Read more

Replace Space of string with character using replace() in Python

Python program to replace a string with given character using replace() function

In this tutorial we are going to learn writing python program to replace a space of string with given character. Problem Statement Our problem statement is, We have one string and a character. Now we want to replace that input character with the all space of string. The main string where the space are available … Read more

Python Program to check given input is digit or not

Check Given Input Is Digit Or Not in python

In this tutorial we are going to learn writing program to check if the a given input is Digit ( 0-9) or not. We will also see the explanation on this python program. Problem statement For the any input, We have to check a given input character is digit or not. For example: Our logic … Read more

Python program to calculate the power using ‘while-loop’

Calculate The Power Using While-Loop in python

In this tutorial, we are going to learn a python program to calculate the power of a given number without using inbuild python pow function. Problem Statement For any two numbers that are inputs given by the user, one is the base value let’s say it as ‘x’ and the other is the exponent let’s … Read more

Python program to calculate the power using ‘for-loop’

Calculate The Power Using For-Loop in python

In this tutorial, we are going to learn a python program to calculate the power of a given number. Problem Statement For any two numbers that are inputs given by the user, one is the base value let’s say it as ‘x’ and the other is the exponent let’s say it as ‘y’, we have … Read more

Python Program to Calculate power using ‘pow()’ method

Calculate The Power Using Pow() Method in python

In this tutorial, we are going to learn a python program to calculate the power of a given number. pow() Method in python In Python, the pow() function is used to calculate the power of a number, that is, to raise a number to the exponent of another. It’s a versatile function that can be … Read more

Python program to calculate the square of a number

Calculate The Square Of A Number in python

In this tutorial, we are going to learn a python program to calculate the square of a given number. Problem Statement For any number that are inputs given by the user, we have to print x2, i.e. square of that number.  For example: Our logic to calculate the square of a given number Algorithm to … Read more

Python program to calculate the square root of a number

Calculate The Square Root Of A Number in python

In this tutorial, we are going to learn a python program to calculate the square root of a given number. Problem Statement For any number that are inputs given by the user, we have to print the square root of that number.  For example: Our logic to calculate the square root of a given number … Read more

Python program to find smallest number among three

python program to Find Smallest Number Among Three

In this tutorial, we are going to learn a python program to find the smallest number among three numbers that are given by the user. Problem Statement For three numbers that are inputs given by the user, we have to print the smallest among those 3 numbers.  For example: Our Logic to find smallest number … Read more