I am trying to make a function root(x, y)
where it finds the yᵗʰ root of x.
I have tried to use math.sqrt()
here, but it doesn't work.
Here is my code:
def root(x, y):
for i in range(y):
math.sqrt(x)
for i in range(10000):
print(root(i, 2))
And what it gives me:
None
None
None
None
None
and so on...
Please help me solve this problem.