[Tutor] calculate area of a circle
moron.oxy at gmail.com
Wed Apr 15 11:01:24 CEST 2009
On Wed, Apr 15, 2009 at 6:52 PM, mbikinyi brat <mbikinyi_brat at yahoo.com> wrote:
> Hi All,
> This is a code I have written to calculate the area of a circle.
> def area(radius):
> return temp
> I now call it by entering area(12) at the prompt in IDLE. This is the error
> message I get. Can someone help please?
> Traceback (most recent call last):
> File "<pyshell#22>", line 1, in <module>
> File "<pyshell#21>", line 2, in area
> NameError: global name 'math' is not defined
You need to import the 'math' module to use its member pi. Prior to
using the module (e.g. before typing in the area function), type:
Lookup modules for more info (e.g.
More information about the Tutor