Hi Mark,
Thanks.

> [SNIP]
>> Let me give an example:
>>
>> def is_odd(k):
>>      if k % 2 == 0:
>>          return False
>>      else:
>>          return True
>
>
> I'll point out before anyone else does that you can write this function as a
> one line return.  I'll leave you to work out how.  Personally I prefer the
> longer version but each to their own.
>

OK, but if I wrote it as an one-liner, then it wouldn't be much use as
an example for my question...

>[SNIP]
> Don't put it in the class.  It's a general purpose function that can be used
> anywhere so keep it at the module level.
>

OK, thanks. That was the kind of advice I was hoping for.
Ze
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to