Python program to calculate simple interests.

In this python basic program, we will calculate simple interests using the formula P+(P/r)*t.

Steps to solve the program
  1. Take the principal amount, rate of interest, and number of years as input.
  2. Calculate the simple interest using the formula P+(P/r)*t, where P is the principal amount, r is the rate of interest, t is the number of years.
  3. Print the output.
				
					p = 1000
r = 10
t = 2

amount = p+(p/r)*t

print("Amount payable: ",amount)
				
			

Output :

				
					Amount payable:  1200.0
				
			

check whether the given number is an Armstrong number or not.

print the current date in the given format

Check whether the given number is an Armstrong number.

In this python basic program, we will check whether the given number is an Armstrong number or not.

Steps to solve the program
  1. Take a number as input through the user.
  2. See the given example to understand what is an Armstrong number.
  3. Create a variable and assign its value equal to 0.
  4. While the number is greater than 0 divide the number by 10 using % and add the remainder raised to 3 to the variable that we have created.
  5. Now divide the number by 10 using //.
  6. If the value of the variable is equal to the input number then it is an Armstrong number.
  7. Print the output
				
					num = a = 153
rev = 0

while a>0:
    rem = a%10
    rev = rev +rem**3
    a= a//10
    
if rev == num:
    print("It is a armstrong number")
else:
    print("It is not a armstrong number")
				
			

Output :

				
					It is a palindrome number
				
			

calculate the area of the cylinder.

calculate simple interest.

Python program to calculate the area of the cylinder.

In this python basic program, we will calculate the area of the cylinder using the formula 2*PI*r*h + 2*PI*r*r.

Steps to solve the program
  1. Take the radius and height of the cylinder as input through the user.
  2. Calculate the area of the cylinder using the formula: 2*PI*r*h + 2*PI*r*r, where h is the height and r is the radius of the cylinder.
  3. Print the output.
				
					r = int(input("Enter radius of cylinder: "))
h = int(input("Enter height of cylinder: "))
area = 2*3.14*r*h+2*3.14*r*r

print("Area of cylinder: ",area)
				
			

Output :

				
					Enter radius of cylinder: 4
Enter height of cylinder: 5
Area of cylinder:  226.08
				
			

calculate the area of a cube.

check whether the given number is an Armstrong number or not.

Python program to calculate the area of a cube.

In this python basic program, we will calculate the area of a cube. We will use the the formula: 6*side*side,

Steps to solve the program
  1. Take the side of a cube as input through the user.
  2. Calculate the area of the cube using the formula: 6*side*side.
  3. Print the output.
				
					side = int(input("Enter side of a cube: "))
area = 6*side*side

print("Area of cube: ",area)
				
			

Output :

				
					Enter side of a cube: 6
Area of cube:  216
				
			

calculate the area of a circle.

calculate the area of the cylinder.

Python program to calculate the area of a circle.

In this python basic program, we will calculate the area of a circle.

Steps to solve the program
  1. Take the radius of the circle as input through the user.
  2. Calculate the area of a circle using the following formula: Pi*r*r, where pi is equal to 3.14 and r is the radius of the circle.
  3. Print the output.
				
					radius = int(input("Enter radius of circle: "))
area = 3.14*radius*radius

print("Area of circle: ",area)
				
			

Output :

				
					Enter radius of circle: 4
Area of circle:  50.24
				
			

calculate the area of the square.

calculate the area of a cube.

Python program to calculate the area of the square.

In this python basic program, we will calculate the area of the square.
Formula: area = side^2

Steps to solve the program
  1. Take a side of a square as input through the user.
  2. To calculate the area of the square use the following formula: side^2.
  3. Print the output.
				
					side = int(input("Enter the side of a square: "))
print("Area of sqaure: ",side**2)
				
			

Output :

				
					Enter the side of a square: 10
Area of sqaure:  100
				
			

solve the given math formula. Formula : (a – b)3 = a3 – 3a2b + 3ab2 – b3

calculate the area of a circle.

Python program to solve the given math formula.

In this python basic program, we will solve the given math formula.
Formula : (a – b)3 = a3 – 3a2b + 3ab2 – b3

Steps to solve the program
  1. Take two variables as input and assign value to them.
  2. Using logic solve the given math formula.
  3. Formula : (a – b)3 = a3 – 3a2b + 3ab2 – b3
  4. Print the output.
				
					a = 3
b = 2
result = a**3-3*a**2*b+3*a*b**2+b**3

print("(a-b)^3: ",result)
				
			

Output :

				
					(a-b)^3:  17
				
			

solve the given math formula. Formula : (a + b)3 = a3 + 3ab(a+b) + b3 

calculate the area of the square.

Python program to solve the given math formula.

In this python basic program, we will solve the given math formula.
Formula : (a + b)3 = a3 + 3ab(a+b) + b3 

Steps to solve the program
  1. Take two variables as input and assign value to them.
  2. Using logic solve the given math formula.
  3. Formula : (a + b)3 = a3 + 3ab(a+b) + b3 
  4. Print the output.
				
					a = 3
b = 2
result = a**3+3*a*b*(a+b)+b**3

print("(a+b)^3: ",result)
				
			

Output :

				
					(a+b)^3:  125
				
			

solve the given math formula. Formula : a2 – b2 = (a-b)(a+b)

solve the given math formula. Formula : (a – b)3 = a3 – 3a2b + 3ab2 – b3

Python program to solve the given math formula.

In this python basic program, we will solve the given math formula.
Formula : a2 – b2 = (a-b)(a+b)

Steps to solve the program
  1. Take two variables as input and assign value to them.
  2. Using logic solve the given math formula.
  3. Formula : a2 – b2 = (a-b)(a+b)
  4. Print the output.
				
					a = 3
b = 2
result = (a+b)*(a-b)

print("(a^2-b^2): ",result)
				
			

Output :

				
					(a^2-b^2):  5
				
			

solve the given math formula. Formula : (a – b)2 = a^2 + b^2 – 2ab

solve the given math formula. Formula : (a + b)3 = a3 + 3ab(a+b) + b3 

Python program to solve the given math formula.

In this python basic program, we will solve the given math formula.
Formula : (a – b)2 = a^2 + b^2 – 2ab

Steps to solve the program
  1. Take two variables as input and assign value to them.
  2. Using logic solve the given math formula.
  3. Formula : (a – b)2 = a^2 + b^2 – 2ab
  4. Print the output.
				
					a = 2
b = 3
result = a**2-2*a*b+b**2

print("(a-b)^2: ",result)
				
			

Output :

				
					(a-b)^2:  1
				
			

solve the given math formula.
Formula : (a + b)2 = a^2 + b^2 + 2ab

solve the given math formula. Formula : a2 – b2 = (a-b)(a+b)