To Whom it May Concern,
I'm trying to get this code working. Here's my question:
Consider a triangle with sides of length 3, 7, and 9. The law of cosines states 
that given three sides of a triangle (a, b, and c) and angle C between sides a 
and b: Write Python code to calculate the three angles in the triangle.
Here's my code:
# Calculate the angles in a triangle
# Imports the Math data
import math
# Sets up the different angles with corresponding letters
# The first angle is a
a = 3
# The second angle is b
b = 7
# The third angle is c
c = 9
# Calculates angle "C"
print(math.acos(((a**2)+(b**2)-(c**2))/(2(a*b))))
Here's my output:
Traceback (most recent call last):
  File "E:\Programming\Problem4.py", line 12, in <module>
    print(math.acos(((a**2)+(b**2)-(c**2))/(2(a*b))))
TypeError: 'int' object is not callable

Steven Carpenter
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to