Reputation: 9
What I currently have is
x = float(input("Side opposite unknown angle: "))
y = float(input("Second Side: "))
z = float(input("Third Side: "))
print ("Angle is: "+str((x**2+y**2-z**2)/2*x*y)*math.acos)
And the error I receive is
print ("Angle is: "+str((x**2+y**2-z**2)/2*x*y)*math.acos)
TypeError: can't multiply sequence by non-int of type 'builtin_function_or_method'
Upvotes: 0
Views: 1446
Reputation: 14771
print ("Angle is: "+str((x**2+y**2-z**2)/2*x*y)*math.acos)
should be
print ("Angle is: "+str(math.acos((y**2+z**2-x**2)/(2*y*z)))
Notice where the parenthesis are.
Problems:
math.acos
is a function that should be invoked.str
should include the result of math.acos
Upvotes: 1
Reputation: 74675
Replace math.acos
with math.acos((x/360.0)*2*math.pi)
if x
is in degrees or just math.acos(x)
if x
is in radians. Also move it within the call to str
.
Upvotes: 0