beginner question (True False help)

eschneider92 at comcast.net eschneider92 at comcast.net
Wed Aug 7 04:17:21 EDT 2013


I'm trying to create an option for the program to repeat if the user types 'y' or 'yes', using true and false values, or otherwise end the program. If anyone could explain to me how to get this code working, I'd appreciate it.

letters='abcdefghijklmn'
batman=True
def thingy():
    print('type letter from a to n')
    typedletter=input()
    if typedletter in letters:
        print('yes')
    else:
        print('no')
def repeat():
    print('go again?')
    goagain=input()
    if goagain in ('y', 'yes'):
        print('ok')
    else:
        print('goodbye')
        batman=False
while batman==True:
    thingy()
    repeat()
    print('this is the end')



More information about the Python-list mailing list