Write a script file prompts a user for the three sides of a
Solution
1.
import math
#inputing values
a = input(\"Enter side a: \")
b = input(\"Enter side b: \")
c = input(\"Enter side c: \")
#calculating angles using math.acos and converting them to degrees using math.degrees
C = math.degrees(math.acos((a**2.0+b**2.0-c**2.0)/(2.0*a*b)))
A = math.degrees(math.acos((b**2.0+c**2.0-a**2.0)/(2.0*b*c)))
B = math.degrees(math.acos((c**2.0+a**2.0-b**2.0)/(2.0*c*a)))
#outputing values
print \"A = \", A, \"B = \", B, \"C = \", C
2.
import math
#inputing values for a, b and c
print \"Assume that the quadratic equation is of the form: ax^2 + bx + c.\"
print \"The input the values of a, b and c.\"
a = input(\"a: \")
b = input(\"b: \")
c = input(\"c: \")
#checking if discriminant < 0,
if b**2-4.0*a*c<0:
print \"This equation doesn\'t have real roots.\"
else:
#calculating values of roots using the quadratic formula
root1 = (-b+math.sqrt(b**2-4.0*a*c))/(2.0*a)
root2 = (-b-math.sqrt(b**2-4.0*a*c))/(2.0*a)
#outputing the roots
print \"The roots are,\", root1, \"and\", root2
