0

I am ask the user to specify air or car and then the program should print "book air travel" if the user says air and "book a car or hotel" if the user says car. But it seems when I put car it is still printing "book air travel". What am I missing?

travel=raw_input("What type of travel is required Air or Car")
if travel == "Air" or "air":
    print "book air travel"
elif travel== "Car" or "car":
    print "book a car or hotel"
user3527972
  • 89
  • 2
  • 7

1 Answers1

3

Do it like this

travel=raw_input("What type of travel is required Air or Car").lower()
if travel == "air":
    print "book air travel"
elif travel== "car":
    print "book a car or hotel"

Make it lower case from the start to avoid having multiple checks.

Paul Rooney
  • 20,879
  • 9
  • 40
  • 61