# Python Program to Create a Class and Compute the Area and the Perimeter of the Circle

In this example, we will write a python program to find the area and perimeter of the circle using class and objects. To better understand this example, make sure you have knowledge of the following tutorials:-

## Python Program to Create a Class and Compute the Area and the Perimeter of the Circle

import math

class Circle:

def area(self):
return math.pi * (self.radius ** 2)

def perimeter(self):
return 2 * math.pi * self.radius

r = int(input("Enter radius of circle: "))
obj = Circle(r)
print("Area of circle:", round(obj.area(), 2))
print("Perimeter of circle:", round(obj.perimeter(), 2))

The output of the above program is:-