[Tutor] can i pass a list to a function and get one back ?

shawn bright nephish at gmail.com
Sun Oct 22 04:12:36 CEST 2006


great, thanks,  i have idle right here, would have been just as easy.
sorry about that
sk

On 10/21/06, Bill Campbell <bill at celestial.net> wrote:
>
> On Sat, Oct 21, 2006, shawn bright wrote:
> >
> >   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 ?
>
> Ayup!
>
> The best way to find answers to questions like this is to just do
> it, and see what python does.
>
> Bill
> --
> INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
> URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
> FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206)
> 236-1676
>
> ``It will be of little avail to the people that the laws are made by men
> of
> their own choice if the laws be so voluminous that they cannot be read, or
> so incoherent that they cannot be understood.''
>     -James Madison, Federalist Paper #62
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061021/4a8abdf5/attachment.htm 


More information about the Tutor mailing list