For this Question: Write a single function which calculates the area of different shapes like circle, rectangle, square, triangle
Key for input:
triangle base height
circle radius
rectangle length base
square side

Take pi=3.14
Inputs will be in integer so print upto 4 decimal places1st line: Number of inputs
Next n lines: Shapes with dimensionn lines: for different areasSample:

Input:
4
Rectangle 4 5
Circle 5
Square 5
Triangle 4 5

Output:
20
78.5
25
10.0
, I have written this Solution Code: class Circle:
  pi=3.14
  def __init__(self,radius):
    self.radius=radius
  def area(self):
    return self.pi*self.radius*self.radius

class Rectangle:
  def __init__(self,length,breadth):
    self.length=length
    self.breadth=breadth
  def area(self):
    return self.length*self.breadth

class Triangle:
  def __init__(self,base,height):
    self.base=base
    self.height=height
  def area(self):
    return 0.5*self.base*self.height

class Square:
  def __init__(self,side):
    self.side=side
  def area(self):
    return self.side*self.side

def calculate_area(shape):
  print(shape.area())


n=int(input())
for i in range(n):
  s=input().strip().split()
  if(s[0]=="Circle"):
    sh=Circle(int(s[1]))
    calculate_area(sh)
  elif(s[0]=="Rectangle"):
    sh=Rectangle(int(s[1]),int(s[2]))
    calculate_area(sh)
  elif(s[0]=="Square"):
    sh=Square(int(s[1]))
    calculate_area(sh)
  else:
    sh=Triangle(int(s[1]),int(s[2]))
    calculate_area(sh)
  , In this Programming Language: Python, Now tell me if this Code is compilable or not?