Print the square and cube of a given number.

In this python basic program, we will print the square and cube of a given number using the ** method.

Steps to solve the program
  1. Take a number as input.
  2. Print the square and cube using the ** (power) method.
  3. To print the square use  **2 and for the cube use **3.
  4. Print the output.
				
					num = 9

print("Square: ",num**2)
print("Cube: ",num**3)
				
			

Output :

				
					Square:  81
Cube:  729
				
			

get the median of given numbers.

interchange values between variables.

Leave a Comment