lundi 21 novembre 2016

Python: Elif and Else not working [duplicate]

This question already has an answer here:

I'm constructing an interactive timetable for terminal with Python, but at the end of my code where i have if, elif and else statements no matter what user input i give it keeps passing the if statement. Any Solutions would be greatly appreciated and Thank You for your time :)

while True:
    TimeTable()
    print "\nDo you wish to go again? "
    answer = raw_input()
    if answer == "Yes" or "yes":
        print " "
        continue
    elif answer == "No" or "no":
        print "Ok then"
        break
    else:
        print "Ok then"
        break

Aucun commentaire:

Enregistrer un commentaire