I'm a beginner with python. I've created a little program for my navigation homework which when I input the data solves it for me but it's not working. It asks the initial question to determine which type of problem to solve and then, when it's supposed to solve it, it crashes. Why is that?
import math
print("Insert all values in degree decimal form.")
prob = input("1 or 2")
if prob == 1:
fia = input("Insert value of phi in A: ")
lama = input("Insert value of lambda in A: ")
route = input("Insert value of true route: ")
vel = input("Insert speed: ")
Tma = input("Insert Established Time of Departure: ")
Tmb = input("Insert Established Time of Arrival: ")
deltaT = Tmb - Tma
print(deltaT)
m = vel * deltaT
print(m)
deltafi = (m / 60) * math.cos(route)
print(deltafi)
fib = fia + deltafi
if fib > 180:
fib1 = -(360 - fib)
fib = fib1
print(fib)
else:
print(fib)
fim = (fia + fib) / 2
print(fim)
deltalam = (m * math.sin(route) / (60 * math.cos(fim)))
lamb = lama + deltalam
if lamb > 180:
lamb1 = -(360 - lamb)
lamb = lamb1
print(lamb)
else:
print(lamb)
print("Coordinates of B: ")
print(fib, lamb, Tmb)
elif prob == 2:
fia = input("Insert value of phi in A: ")
lama = input("Insert value of lambda in A: ")
fib = input("Insert value of phi in B: ")
lamb = input("Insert value of lambda B: ")
deltafi = fib - fia
deltalam = lamb - lama
fim = (fia + fib) / 2
tanroute = (deltalam / deltafi) * math.cos(fim)
route = math.atan(tanroute)
m = (60 * abs(deltafi)) / math.cos(route)