1.

Write a 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. Program using a function that returns the area and circumference of a circle whose radius is passed as an argument. Assign two values using tuple assignment:

Answer»

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) 

Output:

Enter the Radius: 5

Area of the circle = 78.5

Circumference of the circle = 31.400000000000002



Discussion

No Comment Found