a.lathifah
0
Q:

square root in python

import math

toSquare = 300
squared = math.sqrt(toSquare)
20
import math
print(math.sqrt(589485))
1
import math
a = input("what do you wnat to square root")
print(math.sqrt(a))
7
def square_root(num):
  	return num**0.5
#prints out 4
print(square_root(16))
#prints out 10
print(square_root(100))
6
# Python3 program to demonstrate the error in  
# sqrt() method  
  
# import the math module  
import math  
  
# print the error when x<0  
print(math.sqrt(-1))  
6
x = 9
y = x ** 0.5
3
import math
answer = math.sqrt(16)
0
#use ** instead of ² or ^2
0

New to Communities?

Join the community