try / except not worknig correctly

' at '.join([..join(['fred', 'dixon']), ..join(['gmail', ' at '.join([..join(['fred', 'dixon']), ..join(['gmail',
Sat Mar 12 19:20:38 EST 2005


the code below will not execute the except section when i enter a
number.
what am i missing ?

#########################################
.while 1:
.   print 'Pump Protection ? '
.   #line 133
.    try:
.        myInput = raw_input('A B C D E F G H I J K L ? ')
.        myInput = string.upper(myInput)
.        if myInput == 'A':break     #
.        if myInput == 'B':break     #
.        if myInput == 'C':break     #
.        if myInput == 'D':break     #
.        if myInput == 'E':break     #
.        if myInput == 'F':break     #
.        if myInput == 'G':break     #
.        if myInput == 'H':break     #
.        if myInput == 'I':break     #
.        if myInput == 'J':break     #
.        if myInput == 'K':break     #
.        if myInput == 'L':break     #
.    except ValueError:
.         print "Oops! That was no valid number.  Try again..."
.         pass


.'s are to preserve indents.
fred




More information about the Python-list mailing list