def Length(screw, W_req, W, extra): L = W_req/W + extra print('#{} Screws need a minimum length of {:.2f}"'.format(screw,L)) screws = [(6,69), (7,76), (8,82), (9,89), (10,95), (12,108)] for screw, W in screws: Length(screw,80,W,5/8) from numpy import arctan, degrees, cos, sin, sqrt alpha = arctan(80/40) print("Angle = {:.2f} degrees".format(degrees(alpha))) Z_a = (82*1.375*52.8)/(82*1.375*cos(alpha)**2 + 52.8*sin(alpha)**2) print("The combined load resistance Z_a = {:.2f} lb".format(Z_a)) print("The required Z_a = {:.2f} lb".format(sqrt(80**2+40**2)))