I'm quite new to python so sorry if this is an easy answered question but i'm trying to create a trigonometry calculator. Heres some code:
print("What function would you like to calculate? (tan, cos or sin) !CASE SENSETIVE!")
f = input()
if f == "tan" or "tangent":
print("Is \'x\' opposite or adjacent?")
f = str(input())
if f == "adjacent" or "adj":
print("What is your opposite side value (whole number)")
o = int(input())
print("What is your angle value (whole number)")
t = int(input())
a = o/math.tan(math.radians(t))
print(a)
elif f == "opposite" or "opp":
print("What is your adjacent side value (whole number)")
a = int(input())
print("What is your angle value (whole number)")
t = int(input())
o = a*math.tan(math.radians(t))
print(o)
So it starts by running smoothly asking if the user want to use tan, cos or sin (for this case I want to use tan)
I enter tan and it prints "Is 'x' opposite or adjacent" like it should but no matter what I type it's always going to output "What is your opposite side value (whole number)" instead of "What is your adjacent side value..."
Please help me sorry again if this is an easy answer i'm new to the python language
Aucun commentaire:
Enregistrer un commentaire