Re: [Tutor] Changing the value in a list

2010-03-11 Thread Ken G.
Okay, I understand now. Thanks! Ken Steve Willoughby wrote: On Thu, Mar 11, 2010 at 10:32:45AM -0500, Ken G. wrote: list = ['physics', 'chemistry', 1997, 2000] This is a list of 4 elements, and lists allow elements to be changed, so list[2] = 2010 Will change the v

Re: [Tutor] Changing the value in a list

2010-03-11 Thread Ken G.
Okay, now, it is understood. Thanks. Ken Andre Engels wrote: On Thu, Mar 11, 2010 at 4:32 PM, Ken G. wrote: If the following program change list[2] to 2010, replacing 1997 (and it does), why doesn't the second program work in changing line[ 9:11] to 20 from 08? FIRST PROGRAM: list = ['

Re: [Tutor] Changing the value in a list

2010-03-11 Thread Steve Willoughby
On Thu, Mar 11, 2010 at 10:32:45AM -0500, Ken G. wrote: >list = ['physics', 'chemistry', 1997, 2000] This is a list of 4 elements, and lists allow elements to be changed, so >list[2] = 2010 Will change the value of list to be ['physics','chemistry',1997,2010] >line = [20100208208411

Re: [Tutor] Changing the value in a list

2010-03-11 Thread Andre Engels
On Thu, Mar 11, 2010 at 4:32 PM, Ken G. wrote: > If the following program change list[2] to 2010, replacing 1997 (and it > does), why doesn't the second program work in changing line[ 9:11] to 20 > from 08? > FIRST PROGRAM: > >   list = ['physics', 'chemistry', 1997, 2000] >   print list[2] >   li

[Tutor] Changing the value in a list

2010-03-11 Thread Ken G.
If the following program change list[2] to 2010, replacing 1997 (and it does), why doesn't the second program work in changing line[ 9:11] to 20 from 08? FIRST PROGRAM: list = ['physics', 'chemistry', 1997, 2000] print list[2] list[2] = 2010 print list[2] OUTPUT: 1997 2010