-sk
On 10/21/06, Danny Yoo <[EMAIL PROTECTED]
> wrote:
> great, thanks, i have idle right here, would have been just as easy.
> sorry about that
No problem; it's cool.
>> > hey there, i was just wondering if i could get a list back from a
>> > function.
>> > something like
>> > def return_a_list(some_var):
>> > some_list = []
>> > for i in range(5):
>> > var = some_var + i
>> > some_list.append(var)
>> > return some_list
>> > is this cool ?
It's cool. *grin*
One small comment: we often don't need to use temporary variables like
'var'.
def return_a_list(some_var):
some_list = []
for i in range(5):
some_list.append(some_var + i)
return some_list
Sometimes a temporary variable is useful, and sometimes not. Here, it
seems like it's not too necessary.
Good luck!
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor