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
radius= input("please enter the radius of the cirle: ")
area= float(math.pi*radius**2)
circumference= float(2*math.pi*radius)
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):
return math.pi * radius**2