Insert a value to a list within a list - python -
say have following:
wholelist = ['a', 'b', ['1', '2', '4'], 'c', 'd']
how add value '3' numeric list within wholelist, @ point after value '2' before value '4'?
index correct sublist, use list
's insert
method.
wholelist[2].insert(2, '3')
Comments
Post a Comment