Speaking Python

Dave Benjamin ramen at lackingtalent.com
Mon Oct 13 21:01:52 EDT 2003


In article <APHib.73$7a4.60 at newsread4.news.pas.earthlink.net>, Andrew Dalke wrote:
> Here's how I would say it to someone who is typing
> for me, given that the person knows some Python syntax
> and given an editor which does auto indentation -- the
> proverbial man-behind-the-curtains approach to speech
> recognition:
> 
> Define a new function named range underscore sum which takes
> a single parameter, capital N.
> 
> If n is less than 0, return none.
> If n is 1, return 1
> otherwise

I tried writing this blindly, and almost got the same code except for that
second If, where I got:

    if N is 1:
        return 1

Two mistakes: 1. due to the lack of "otherwise", I assumed an "if" instead of
an "elif"; 2. the difference between "=", "==", and "is" is important to
nail down.

> backspace once

I think "dedent" would be a better choice than "backspace".

-- 
.:[ dave benjamin (ramenboy) -:- www.ramenfest.com -:- www.3dex.com ]:.
: d r i n k i n g   l i f e   o u t   o f   t h e   c o n t a i n e r :




More information about the Python-list mailing list