[Tutor] Sqrt on a variable

Ian Witham witham.ian at gmail.com
Wed Oct 10 02:30:59 CEST 2007


On 10/9/07, samir amassine <samirgimlilegolas at hotmail.com> wrote:
>
> hello,
> i can't seem to use the sqrt function on a variable, do you know how i
> can???
> i want to make the ABC formula
>
> Samir
>


Hi Samir,

You could import sqrt from the math module OR, you can do it without
importing anything by raising to the power of a half.

So, instead of using sqrt(x) you could use: x ** .5

Ian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071010/dabff093/attachment.htm 


More information about the Tutor mailing list