Output
circle1
circle1: Circle
circle2
circle2: Circle
circle3
circle3: Circle
Variable Name     Value in Memory
number1
number2
answer
  1  import math 
  2  
  3  class Circle:
  4      # Construct a circle object 
  5      def __init__(self, radius = 1):
  6          self.radius = radius
  7  
  8      def getPerimeter(self):
  9          return 2 * self.radius * math.pi
 10  
 11      def getArea(self):
 12          return self.radius * self.radius * math.pi
 13            
 14      def setRadius(self, radius):
 15          self.radius = radius
 16  
 17  def main():
 18      # Create a circle with radius 1
 19      circle1 = Circle()
 20      print("The area of the circle of radius",
 21          circle1.radius, "is", circle1.getArea())
 22  
 23      # Create a circle with radius 25
 24      circle2 = Circle(25)
 25      print("The area of the circle of radius",
 26          circle2.radius, "is", circle2.getArea())
 27  
 28      # Create a circle with radius 125
 29      circle3 = Circle(125)
 30      print("The area of the circle of radius",
 31          circle3.radius, "is", circle3.getArea())
 32  
 33      # Modify circle radius
 34      circle2.radius = 100
 35      print("The area of the circle of radius", 
 36          circle2.radius, "is", circle2.getArea())
 37  
 38  main() # Call the main function