Computer Science, asked by samarthlondhe26, 10 hours ago

Write a Python Program to input the radius value and calculate area and perimeter of circle.

Answers

Answered by devindersaroha43
3

Answer:

Explanation:

import math

# Here we make a permimeter function using 2 x PI x R

def permimeter(r):

  return 2*math.pi*r

# Here is the area function using PI x R x R ( or R^2 )

def area(r):

  return math.pi*r*r

# Take the input and convert to integer

radius = int(input("Enter the radius: "))

# Calculate perimeter

myPerimeter = perimeter(radius)

# Calculate area

myArea = area(radius)

# Print the output

print(f"Perimeter: {myPerimeter}\nArea: {myArea}")

Similar questions