On 7 Jun 2015 00:06, "Steve Burrus" <steveburru...@gmail.com> wrote:
>
> I need some help/assistance with using the python "import math" function.
Like I am trying to do a = math.sqrt(1000)
>                   a.sqrt
> but it fails. what am I doing wrong? Thanx for anyone's help.
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list

Here's what your code did:

import math  # make the math module accessible
a = math.sqrt(1000)  # set `a` to the square root of 1000 (≈31.62...)
a.sqrt  # get a reference to the sqrt method/attribute of a float, which
does not exist; moreover you are not calling the method/discarding the
value so it would be useless anyways

-- 
Chris Warrick <https://chriswarrick.com>
Sent from my Galaxy S3.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to