[Tutor] sqrt?

Steven D'Aprano steve at pearwood.info
Sun Apr 25 06:00:16 CEST 2010


On Sun, 25 Apr 2010 01:00:50 pm Kirk Z Bailey wrote:
> ok gang, My desktop runs 2.5, and for my college algebra I needed to
> do som quadratic equation work. This involves squareroots. So I fired
> uop the interactive idle and imported math. I then tried to play with
> sqrt.
>
> Nothing.
>
> Importing math does not import a sqrt function.

It works for me.


[steve at sylar ~]$ python
Python 2.5 (r25:51908, Nov  6 2007, 16:54:01)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.sqrt(4)
2.0
>>> math.sqrt(12.5)
3.5355339059327378



> Now riddle me this: if string.foo makes it do a function FOO on a
> string, whyfore and howcome does math.sqrt not do square roots on a
> simple number like 4???
>
> I am now officiciously pissed.

Perhaps you should drink less alcohol before posting then.

*wink*


(For those in the US, in British and Australian English, to be "pissed" 
is to be drunk. Being angry is "pissed off".)




-- 
Steven D'Aprano


More information about the Tutor mailing list