[Tutor] Array

Magnus Lycka magnus@thinkware.se
Wed Jan 29 13:35:02 2003


At 17:21 2003-01-29 +0000, Denis Hanley wrote:
>what I need to do is create an Array.

If you tell us what you want to achieve, we'll tell *you*
what you need to create! ;)

>LineData = array[x1 y1, x2 y2, x3 y3, etc]

 >>> lineData = [ (1,2), (3,4), (5, 6) ]

>Line x1 y1  x2 y2
>Line x2 y2 x3 y3
>Line x3 y3 x4 y4

 >>> pos = 0
 >>> while pos < len(lineData) -1:
...     print "Line", lineData[pos], lineData[pos + 1]
...     pos = pos + 1
...
Line (1, 2) (3, 4)
Line (3, 4) (5, 6)



-- 
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se