2 Replies - 855 Views - Last Post: 15 March 2012 - 09:16 AM Rate Topic: -----

#1 Coconutmilk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-March 12

Area of Triangle simple syntax errors

Posted 15 March 2012 - 09:00 AM

I think I'm missing something obvious but cannot seem to figure this out.

def main():
    import math
    a = eval(input("What is a?"))
    b = eval(input("What is b?"))
    c = eval(input("What is c?"))
    s = (float(a+b+c)/2
    y = math.sqrt(x)
    x = math.sqrt(s * (s - a) * (s - B)/> * (s - c))
    print("The area of the triangle is.")
    print("x,y")

main()


I keep getting invalid syntax errors wherever I try to do. I know I'm missing something really easy just cant figure it out.

Is This A Good Question/Topic? 0
  • +

Replies To: Area of Triangle simple syntax errors

#2 Motoma  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 452
  • View blog
  • Posts: 797
  • Joined: 08-June 10

Re: Area of Triangle simple syntax errors

Posted 15 March 2012 - 09:07 AM

You have an open parentheses on line 6.
Was This Post Helpful? 0
  • +
  • -

#3 Coconutmilk  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 15-March 12

Re: Area of Triangle simple syntax errors

Posted 15 March 2012 - 09:16 AM

Thanks, also didn't need line 7
cheers!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1