filmov
tv
Python Program to find Cube and Square Root

Показать описание
This video is a tutorial on how to find Cube and Square Root in Python
I hope this video will be helpful to you.
I am also giving the code of this program.
print("This is a Python program to find Square and Cube Root")
response = int(input("What's your choice....Square or Cube Root...1 for square and 2 for Cube root: ")))
if (response == 1):
num1 = int(input(print("Which number do you want to find the square root of? ")
sq_root1 = num1**0.5
sq_root = round(sq_root1)
print("The square root of ",num1,"is ",sq_root)
else
num2 = int(input(print("Which number do you want to find the cube root of? ")
cb_root1 = num2**0.33
cb_root = round(cb_root1)
print("The cube root of ",num2,"is ",cb_root)
This is all the coding part.
Thank you!
I hope this video will be helpful to you.
I am also giving the code of this program.
print("This is a Python program to find Square and Cube Root")
response = int(input("What's your choice....Square or Cube Root...1 for square and 2 for Cube root: ")))
if (response == 1):
num1 = int(input(print("Which number do you want to find the square root of? ")
sq_root1 = num1**0.5
sq_root = round(sq_root1)
print("The square root of ",num1,"is ",sq_root)
else
num2 = int(input(print("Which number do you want to find the cube root of? ")
cb_root1 = num2**0.33
cb_root = round(cb_root1)
print("The cube root of ",num2,"is ",cb_root)
This is all the coding part.
Thank you!