0

My tan solver is a work in progress but when I run it. It does not run past known_side

 import math
angle = raw_input("what is the angle of your triangle ?")
solve_side = raw_input("For adjacent enter 1,opposite 2 and Hypotneous 3")
known_side = raw_input("For adjacent enter 1,oppsite 2 and Hypotneous 3")
if solve_side == 1 and known_side == 2 :
    length_opposite = raw_input("length of the oppisite")
    answer = math.tan(angle) / length_opposite
    print answer
Zubin JAIN
  • 49
  • 3
  • 4
    `raw_input` returns a string, which you then compare to an integer value. That's `false` so the if statement is skipped. Use the `int` function to convert your inputs, or compare them to the string values "1" and "2". – Bill the Lizard Mar 10 '16 at 13:41
  • To add on @BilltheLizard's comment, you can cast the variable to the other data type (i.e., `int(solve_side)`) or compare it with a string (i.e., `solve_side=='1'`) – Chuck Mar 10 '16 at 13:44

0 Answers0