[Tutor] <TUTOR>My first (er...working...) script ever

Tim Wilson wilson@visi.com
Sat Feb 22 17:17:11 2003


On Friday 21 February 2003 17:17, Predrag Ivanovic wrote:

> Programming and Python are pretty much new to me,but it's been fun so
> far... So,i would like comments on code below,especially on style(or lack
> of it..)

Hi Pedja,

For all matters of Python programming style, I consult Guido's style guide 
at http://www.python.org/doc/essays/styleguide.html

One little thing you can do is use docstrings for documenting your 
functions.

> ## circle area
> def krug(radius) :
>     return  (math.pi*radius)

Would become...

def krug(radius):
    """Return the circle's radius."""
    return math.pi * radius**2

-Tim

-- 
Tim Wilson
Twin Cities, Minnesota, USA
Science teacher, Linux fan, Zope developer, Grad. student, Daddy
mailto:wilson@visi.com | http://qwerk.org/ | public key: 0x8C0F8813