Session03

List_lab homework from session03
Rot13 homework from Session 3
Thanks, that was the problem. That's consistent with my testing results,
which were returning the lower cases characters as themselves, because they
were fed from one conditional to the next, while the upper case characters
were changed as desired.

On Wed, Dec 10, 2014 at 8:59 PM, Joshua Frailey <notifications@github.com>
wrote:

> In Students/JesseKlein/session03/rot13.py
> <https://github.com/codefellows/sea-c28-students/pull/82#discussion-diff-21658158>
> :
>
> > +    bool = False
> > +
> > +    if type(string) == str:
> > +        string = unicode(string)
> > +
> > +        #Turn on the switch
> > +        bool = True
> > +
> > +    string2 = u""
> > +
> > +    for i in string:
> > +
> > +        #This conditional contains both sets of the front half of the alphabet
> > +        if ord(i) >= ord(u"A") and ord(i) <= ord(u"M") or ord(i) >= ord(u"a") and ord(i) <= ord(u"m"):
> > +            i = unichr(ord(i) + 13)
> > +
>
> This function brakes if you change the if...elif to two separate if
> statements because you're binding the symbol i to the shifted string
> ordinal in line 24 and then using that same symbol in the conditional for
> the second if statement. This means that if i is initially a character in
> the 'lower_half', then it'll be rebound to a character in the 'upper_half'
> in line 24. The conditional for the second if statement is designed to
> trigger for all 'upper_half' characters, so it'll convert i back to its
> original value.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/codefellows/sea-c28-students/pull/82/files#r21658158>.
>