How to get Square root of a number without import anything in python?

345 views Asked by At

How to get Square root of a number without import anything in python? You know we can do this:

import math
a = 4
s = math.sqrt(a)

but i want do this more simple without import any library.

1

There are 1 answers

0
Kasra Najafi On BEST ANSWER

You can do this using Exponentiation in python line this:

a = 4
b = a ** 0.5    #(1/2)