On 4/24/2010 9:00 PM Steven D'Aprano said...
On Sun, 25 Apr 2010 01:00:50 pm Kirk Z Bailey wrote:
Importing math does not import a sqrt function.

Hmm... mine's there, but hey, it's easy to roll your own:

ActivePython 2.6.1.1 (ActiveState Software Inc.) based on
Python 2.6.1 (r261:67515, Dec 5 2008, 13:58:38) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> def sqrt(x): return x**.5
...
>>> sqrt(4)
2.0
>>> sqrt(12)
3.4641016151377544


Emile


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to