[Tutor] Newb Learning Question

bob gailer bgailer at alum.rpi.edu
Thu Apr 3 02:01:16 CEST 2008


Alan Gauld wrote:
> "Jeffrey Dates" <kungfukoi at gmail.com> wrote
>
>   
>> Let me get back to you with my result after I study this a bit.
>> thanks!!
>>     
>
> One wee tip you might find useful.
>
> To test if a lertter comes after 'm you could
>
> a) create a string with all letters after m
>
>   
>>>> after_m = 'nopqrstuvwxyz'
>>>>         
>
> then test whether your characters were in after_m:
>
>   
>>>> if c in after_m: print c
>>>>         
>
> OR
>
> b) see if the ascii value of your character is bigger 
> than the ascii value of 'm' And you can check the 
> ascii value using ord()
>   

3rd alternative: if c > 'm': print c
> There are pros and cons to both approaches. 
> Pick the one you like best, we can debate 
> the ideal solution for any given case later...
>
>   


-- 
Bob Gailer
919-636-4239 Chapel Hill, NC



More information about the Tutor mailing list