Ask coding questions

← Back to all posts
I need help with finding square root with importing "math"
MartinRimes (2)

i am making a calculator and I need to find the square root of a number but am having trouble using the command for finding square root "sqrt()" I am importing "math" but it thinks that the "sqrt" is a variable

ZhongRietveld (30)

I think you can use this

new_number = sqrt(number)

MartinRimes (2)

this did not work but I did manage to find what was wrong I just needed to put math. before the sqrt(#) ie i was doing this -
but needed to do -

MartinRimes (2)

the code is in