Q:

how to square in python

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
x = 9
y = x ** 0.5
3
import math

8 * 8          # 64
8 ** 2.        # 64
math.pow(8, 2) # 64.0
3
import math
answer = math.sqrt(16)
0
#16 to the power of 2
answer = 16**2
0
#use ** instead of ² or ^2
0
to_square = (2)
squared = (to_square*to_square)
-1

New to Communities?

Join the community