> Also note that I've deliberately left alone a bug in rot1(), to make
> it easier to show a flaw in the original code that you'll want to fix.

Doh.  Never mind.  _I'm_ the one who introduced that regression.  :(  Sorry!


Here's a corrected definition for rot1():

#############################
def rot1(char):
    if char.isupper() or char.islower():
        test = 'M' if char.isupper() else 'm'
        if char <= test:
            return chr(ord(char) + 13)  
        else:
            return chr(ord(char) - 13)
    else:
        return char
#############################


My apologies!
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to