[Tutor] Why does L[3:2] =['test'] differ from L[3]=['test']

Mallett, Roger rmallett@rational.com
Wed, 8 Nov 2000 23:56:59 -0800


If a list L=[1, 2, 3, 4, 5]

then L[3:2]=['test'] yields -> [1, 2, 3, 'test', 5]

however, L[3]=['test'] yields -> [1, 2, 3, ['test'], 5]

Why do the results differ?  (one inserts a string into the list, but the
other inserts a list into the list.)

Roger Mallett