Check whether the input number is a cube of 3

In this python if else program, we will check whether the input number is a cube of 3 or not.

Cube: To find the cube of a number, first, multiply that number by itself 3 times

Steps to solve the program
  1. Take a number as input.
  2. Using an if-else statement check whether the input number is a cube of 3 i.e. 27.
  3. Print the respective output.
				
					num = 27

if num == 27:
    print("True")
else:
    print("False")
				
			

Output :

				
					True
				
			

Related Articles

check whether the input number is a square of 6 or not.

check whether two numbers are equal or not.

Leave a Comment