[Tutor] Newb Learning Question
Jeffrey Dates
jdates at kungfukoi.com
Thu Apr 3 20:37:50 CEST 2008
Exellent suggestion!
thanks!
On Thu, Apr 3, 2008 at 2:17 PM, Sander Sweers <sander.sweers at gmail.com>
wrote:
> 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
> >
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080403/fb60fdbc/attachment.htm
More information about the Tutor
mailing list