0
Quizs time.How to insert a element into a embeded list using insert method or other methed relevant?
transfer a=[1,ļ¼»2,3ļ¼½] to b=[1,ļ¼»2,3,4ļ¼½] is insert method still helpful? aļ¼»1ļ¼½.insert() would work,but it is not very useful in a loop definition. Is there a more simple āinsertā way like a.insert(ļ¼»1ļ¼½ļ¼»2ļ¼½,4) existed?
1 Answer
- 1
a=[1, [2, 3], 6]
a.insert( [10, 8] ,1)
print (a)
>>> [1, [10, 8], [2, 3], 6]
a[2].insert(90, 1)
print (a)
>>>[1, [10, 8], [2, 6, 3], 6]
let me know if it helped...