#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Location
    chicago
    Posts
    0
    Rep Power
    0

    square root function


    how can i use a sqare root function on python. Like if i wanted so square root a number or a variable.

    because in C++ it's sqrt(number) including the math.h header.

    I don't know much about python. Just started today so please be very basic.
  2. #2
  3. No Profile Picture
    Code Poet
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Location
    Boston
    Posts
    9
    Rep Power
    0
    Use the math package:

    Python 2.1.3 (#1, Apr 20 2002, 10:14:34)
    ...
    >>> import math
    >>> math.sqrt(2)
    1.4142135623730951

    --parker

IMN logo majestic logo threadwatch logo seochat tools logo