import numpy as np
import math as m
import turtle as t
s=[3, 4, 5]
#expression below is used to calculate the angle between two sides of a triangle
a1=m.degrees(np.arccos(((s[1]**2 + s[2]**2 - s[0]**2) / (2 * s[1] * s[2]))))
a2=m.degrees(np.arccos(((s[0]**2 + s[2]**2 - s[1]**2) / (2 * s[0] * s[2]))))
a3=m.degrees(np.arccos(((s[0]**2 + s[1]**2 - s[2]**2) / (2 * s[0] * s[1]))))
a=[a1, a2, a3]
print(a)
p=t.Turtle()
for i in range(len(a)):
p.forward(s[i]*25)
p.left(180-a[i])
t.done()
the angles calculated are correct and the turtle is running fine too, except it just doesn't connect at the end. i suspect maybe the angles and the sides must be in different orientation to make it work, but i can't find the correct orientation for that.