=====Problem Statement=====
You are given four points A, B, C and D in a 3-dimensional Cartesian coordinate system. You are required to print the angle between the plane made by the points A, B, C and B, C, D in degrees(not radians). Let the angle be PHI.
Cos(PHI) = (X.Y)/|X|Y| where X = AB x BC and Y = BC x CD.
Here, X.Y means the dot product of X and Y, and AB x BC means the cross product of vectors AB and BC. Also, AB = B-A.

=====Input Format=====
One line of input containing the space separated floating number values of the and coordinates of a point.

=====Output Format=====
Output the angle correct up to two decimal places.

Difficulty: introductory

Starter code:

import math

class Points(object):
    def __init__(self, x, y, z):

    def __sub__(self, no):

    def dot(self, no):

    def cross(self, no):
        
    def absolute(self):
        return pow((self.x ** 2 + self.y ** 2 + self.z ** 2), 0.5)

if __name__ == '__main__':
    points = list()
    for i in range(4):
        a = list(map(float, input().split()))
        points.append(a)

    a, b, c, d = Points(*points[0]), Points(*points[1]), Points(*points[2]), Points(*points[3])
    x = (b - a).cross(c - b)
    y = (c - b).cross(d - c)
    angle = math.acos(x.dot(y) / (x.absolute() * y.absolute()))

    print("%.2f" % math.degrees(angle))

Solutions:
# Enter your code here. Read input from STDIN. Print output to STDOUT

import math
def custom_diff(a,b):
    res0 = a[0] - b[0]
    res1 = a[1] - b[1]
    res2 = a[2] - b[2]
    return [res0,res1,res2]

def dot_product(a,b):
    return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]

def abs_val(a):
    tmp_val=a[0]*a[0]+a[1]*a[1]+a[2]*a[2]
    return math.sqrt(tmp_val)



def cross(a, b):
    c = [a[1]*b[2] - a[2]*b[1],
         a[2]*b[0] - a[0]*b[2],
         a[0]*b[1] - a[1]*b[0]]

    return c

a_str_ar=input().strip().split()
b_str_ar=input().strip().split()
c_str_ar=input().strip().split()
d_str_ar=input().strip().split()

a=list(map(float,a_str_ar))
b=list(map(float,b_str_ar))
c=list(map(float,c_str_ar))
d=list(map(float,d_str_ar))

ab=custom_diff(b,a)
bc=custom_diff(c,b)
cd=custom_diff(d,c)

x=cross(ab,bc)
y=cross(bc,cd)
       
cosphi_top=dot_product(x,y)
cosphi_bottom=abs_val(x)*abs_val(y)
cosphi=cosphi_top/cosphi_bottom

res=math.degrees(math.acos(cosphi))

print(("%.2f" %res))


class Points(object):
    def __init__(self, x, y, z):
        self.x, self.y, self.z = x, y, z

    def __sub__(self, no):
        return Points(self.x - no.x,
                      self.y - no.y,
                      self.z - no.z)

    def dot(self, no):
        return self.x*no.x + self.y*no.y + self.z*no.z

    def cross(self, no):
        return Points(self.y*no.z - self.z*no.y,
                      self.z*no.x - self.x*no.z,
                      self.y*no.x - self.x*no.y)
        
    def absolute(self):
        return pow((self.x ** 2 + self.y ** 2 + self.z ** 2), 0.5)