[Tutor] eazy python question involving functions and parameters

wesley chun wescpy at gmail.com
Mon Sep 21 10:49:11 CEST 2009


>> Just think: 4 players left means that this is the semi final.
>
> What a brilliant answer! It tells him how to do it if he just stops and
> thinks but gives nothing away. I love it. :-)

i agree with alan on this. in fact, i can just picture the brackets in
my head already. :-)


another thing from the OP that no one has addressed yet is what *this* means:

> > Write an expression (not a statement!)

to the veterans, we don't have to think twice, but this may not be
obvious to a beginner. basically, an expression is something like 4 *
5, foo(), [x for x in range(5)], etc. that evaluates to *some* Python
object, like a number, instance, or a list, etc. this also includes
function (calls) because it is associated with the single return value
that comes back from every call.

in contrast, a statement is something that has no intrinsic value (nor
associated Python object), such as print, pass, continue, or any
keywords like those.

hope this helps too!
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list