[Tutor] Newb Learning Question
Sander Sweers
sander.sweers at gmail.com
Thu Apr 3 20:17:05 CEST 2008
Should be replying to the list....Sorry :(
On Thu, Apr 3, 2008 at 11:14 AM, Sander Sweers <sander.sweers at gmail.com> wrote:
> On Thu, Apr 3, 2008 at 8:21 AM, Jeffrey Dates <jdates at kungfukoi.com> wrote:
> > > > 3rd alternative: if c > 'm': print c
>
> <snip>
>
>
> > "Write a program that prints the first letter of a string that comes after
> > 'm' in the alphabet."
> >
> > s = "this is my string"
> > for i in s:
> > if i > 'm':
> > print i
> > break
>
> One potential problem you will have is with upper case letters.
>
> >>> 'N' > 'm'
> False
>
> To make input all lower case use .lower()
>
> >>> 'N'.lower() > 'm'
> True
>
> Greets
> Sander
>
More information about the Tutor
mailing list