1

Basically for this python program it is supposed to identify Toyota, honda, and kia as foreign cars under the Foreign Boolean. Its supposed to return true for those 3 cars but for other ones its supposed to return and/or print false. So far this is my code and I am not sure where I went wrong and hopefully maybe any of yall can explain where I went wrong. Please and thank you. ( this is the original question "A variable, car contains the name of any of the following auto makers: Toyota, Kia, and Honda, set the Boolean variable isForeign to true.")

 Foreign = str(input("Is the car foreign?"))
if Foreign == "Kia" or "kia":
    Foreign = True
    print(Foreign)
elif Foreign == "Honda" or "honda":
    Foreign = True
    print(Foreign)
elif Foreign == "Toyota" or "toyota":
    Foreign = True
    print(Foreign)
else:
    Foreign = False
    print(Foreign)

0 Answers0