[Tutor] assigning portions of list to another

Willi Richert richert@upb.de
Mon, 16 Sep 2002 19:07:29 +0200


On Monday, 16. September 2002 18:23, Joseph Paish wrote:
> nbr1, nbr2, nbr3 = merged_rec[0, 3, 4]

You would have to write

nbr1, nbr2, nbr3 = merged_rec[0], merged_rec[3], merged_rec[4]

as you are only allowed to specify integers or ranges like [2:6] as an index 
to lists.

Have fun,
willi