[Tutor] Livewires Robot-5

Gregor Lingl glingl at aon.at
Fri Nov 21 18:02:13 EST 2003



Leung Cris schrieb:

> I'm working on Livewires' worksheet 5 -- Robot
> (http://www.livewires.org.uk/python/pdf/5-robots.pdf) . I'm 3/4 of the
> way through this sheet, and I've got a player moving with a robot
> chasing it. But now, I'm stuck on " a List of Robot" . They are saying
> something 'bout placing robots inside a list -- but I don't get it!!!
> Please help.

Hi Leung!

I think you are stuck at this point:

About the only thing you might need to know is that the way to add a new
item to a list is to say something like
my_list.append(new_item) .

You can only understand this, if you know something about lists, which
is one sort of sequence or collection (of objects, eg. robots)
in Python. Fortunately there are several Livewires "reference sheets" on
certain fundamental topics of Python programming.
One of them is Refernce sheet A, lists. There (on page 2) you will learn
how to "append" objects to lists.
I recommend that you work through this one an you will easily master
your robot problem. It's located here:

http://www.livewires.org.uk/python/pdf/A-lists.pdf

HTH

Gregor

>
> _________________________________________________________________
> ¨Ï¥Î MSN Messenger¡A»PªB¤Í¦b½u¤W²á¤Ñ: http://messenger.microsoft.com/tc
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>




More information about the Tutor mailing list