I want to be able to output the area of the circle and the cirumference of the circle to the user. so the output is to be "the area of the circle is... and the circumference of the circle is..." and it has to be to 2dp. the question says i will have to call the circumferenceofCircle and areaOfCircle functions. is this the right way to go?

``````import math
print "The area of the circle is,/""area is %.2f and circumference is %.2f. " (radius, circumference)``````

and can you tell me if this return function is correct?.. the function has to have radius as the parameter and returns the area of circle..

``````def AreaOfCircle(radius):

## All 3 Replies

Some error in your print line,look at this.

``````import math
print "With an input off %s area is %.2f\nand circumference is %.2f" % (radius, area, circumference)

'''My output-->
With an input off 4.78 area is 71.78
and circumference is 30.03
'''``````

It`s ok.

``````>>> import math

>>> AreaOfCircle(5)
78.539816339744831
>>> AreaOfCircle(5.4587)
93.611310811738718
>>> AreaOfCircle(.4589)
0.66158551506127805
>>> print math.pi
3.14159265359
>>>``````

But the question asks me to call the functions circumferenceOfCricle and areaOfCircle with my function above.. is this the same?

call the functions circumferenceOfCricle and areaOfCircle

circumferenceOfCricle is not a function as you should see.

To make circumferenceOfCricle to a function

``````def circumference(radius):