I am making a small program that allows a user to enter a flight specification and it will calculate the price. I have implemented a small error catcher, however this error catcher is always true for some reason:
import time
def main():
AMS_DESTINATION = "Schipol, Amsterdam"
GLA_DESTINATION = "Glasgow, Scotland"
AMS_PRICE = 150.00
GLA_PRICE = 80.00
flightSpecification = str(input("Please enter your flight specification: "))
flightDestination = flightSpecification[0:3]
print(flightDestination)
if flightDestination.lower() != 'ams' or 'gla': # This if statement is always true // Why??
print("Please enter a valid flight specification!")
time.sleep(2)
main()
def flightCalculations():
if flightDestination.lower() == 'ams':
userDestination = AMS_DESTINATION
if flightDestination.lower() == 'gla':
userDestination = GLA_DESTINATION
main()
I just need it to completely ignore this if the first three letters of 'flightSpecification' are equal to 'ams' or 'gla'. Thanks.