Creating your Own class
Calculate area and perimeter of circle with class In this task you will be creating your own class for a circle and define two methods to compute its perimeter and area. Name the classĀ Circleand initialize it usingĀ __init__()which takes in argumentĀ radiusalong withĀ selfĀ and initializes its radiusĀ self.radius = radius. Define another two methodsĀ area()andĀ perimeter()which takes only the keywordĀ selfĀ as argument and calculates the area(3.14xradius^2) and perimeter (2*3.14xradius) respectively. Finally, instantiate an object forĀ CircleĀ of radiusĀ 3and save it asĀ circle Calculate the area ofĀ circleusing itsĀ .area()method and save it asĀ circle_area Calculate the perimeter ofĀ circleusing itsĀ .perimeter()method and save it asĀ circle_perimeter Print outĀ circle_areaandĀ circle_perimeter https://code.sololearn.com/c62PbpZ7woqZ/?ref=app