Question: I am trying to take lengths of sides of a triangle from the input and then find the area in child class. I am getting a syntax error for the child class.

Code:

```
class triangle():                                                  # parent class
     def sides(self):
         self.a = float(input("Enter the sides of triangle: "))
         self.b = float(input("Enter the sides of triangle: "))
         self.c = float((input("Enter the sides of triangle: "))
class area(triangle):                                              #child class
     def ar(): 
         s = (a+b+c)/2
         ar =  (s*(s-a)*(s-b)*(s-c)) ** 0.5 
     return ar
p = triangle()
q = area()
p.sides()
print(q.area())

```

Answer: 
This should work

```
class triangle():  # parent class
    def __init__(self, a, b, c):
        self.a = a
        self.b = b
        self.c = c

class area(triangle):  # child class
    def __init__(self, a, b, c):
        super().__init__(a, b, c)

    def ar(self):
        s = (self.a + self.b + self.c) / 2
        ar = (s * (s - self.a) * (s - self.b) * (s - self.c)) ** 0.5
        return ar

a=input()
b= input()
c =input()
q = area(int(a),int(b),int(c))
print(q.ar())

```

There were multiple issues in your code. The main things are:

-> Initialize your variables in constructor **init**() function

-> While inheriting, we use super() command for initializing parent class variables. In your case, a,b,c is not recognizable for child class

-> You just need to find the area of the triangle. You need not want to create an object for parent class here.

and some more..
```
q.ar() #instead of q.area() 

```

Also try fixing your indents