Issues with if and elif statements in 3.3

krismesenbrink at gmail.com krismesenbrink at gmail.com
Thu Aug 8 03:19:58 EDT 2013


def town():
    print ("You stand in the middle of Coffeington while you descide what"
    " to do next, you have herd rumor of the Coffeington Caves that run"
    "under the city, would you like to check them out?")
    answer = input()
    if answer == ("yes") or ("Yes") or ("y"):
        print("You set out for the Coffeington Caves")
    elif answer == ("no") or ("No") or ("n"):
        print("Oh...well im sure you can find something else to do")
    else:
        print("You just stand  there")
town()



i don't know why the "elif" or "else" part of the "if statment" wont trigger. what ends up happening is that regardless of what answer you put in input it will always print out "you set out for the Coffeington Caves". whats supposed to happen is if you say "no" it should just end? i think anway.



More information about the Python-list mailing list