Beginner question

eschneider92 at comcast.net eschneider92 at comcast.net
Tue Aug 6 17:35:44 EDT 2013


Why won't the 'goodbye' part of this code work right? it prints 'ok' no matter what is typed. Much thanks.

def thing():
    print('go again?')
    goagain=input()
    if goagain=='y' or 'yes':
        print('ok')
    elif goagain!='y' or 'yes':
        print('goodbye')
        sys.exit()
thing()



More information about the Python-list mailing list