Write a program that prompts a user to enter the radius of a circle. If the radius is greater than zero then calculate and print the area and circumference of the circle.

 from math import pi

r = float(input ("Enter radius of circle : "))

if r>0:

print ("Area of the circle is: " + str(pi * r**2))

print ("Circumference of the circle is: " + str(2 * pi * r))

else:

print(" ")

Comments