[Tutor] list.append(x) but at a specific 'i'

bob gailer bgailer at gmail.com
Wed Sep 22 01:17:22 CEST 2010


  On 9/21/2010 6:30 PM, Norman Khine wrote:
> a = ['a', 'b', 'e']
> >>>  b = ['c', 'd']
> i want to put the items of 'b' at [-2] for example.
>
 >>> a[-2:-2]=b
 >>> a
['a', 'c', 'd', 'b', 'e']
 >>>

-- 
Bob Gailer
919-636-4239
Chapel Hill NC



More information about the Tutor mailing list