Programming Examples

Python program using a function that returns the area and circumference of a circle whose radius is passed as an argument


Write a python program using a function that returns the area and circumference of a circle whose radius is passed as an argument.two values using tuple assignment

Solution

pi = 3.14
def Circle(r):
	return (pi*r*r, 2*pi*r)
radius = float(input("Enter the Radius: "))
(area, circum) = Circle(radius)
print ("Area of the circle = ", area)
print ("Circumference of the circle = ", circum)
▶ RUN

Output/ Explanation:

Enter the Radius: 5

Area of the circle = 78.5

Circumference of the circle = 31.400000000000002

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad