How to add value into sub-list
Question:
Looking for a way to add value 555 right after 6000 to make it and display it.
mylist = [4, 11, [300, 400, [5000, 6000, 555], 500], 30, 40]
Original list below.
mylist = [4, 11, [300, 400, [5000, 6000], 500], 30, 40]
Answers:
Can you try adding append to corresponding index
mylist[2][2].append(555)
Looking for a way to add value 555 right after 6000 to make it and display it.
mylist = [4, 11, [300, 400, [5000, 6000, 555], 500], 30, 40]
Original list below.
mylist = [4, 11, [300, 400, [5000, 6000], 500], 30, 40]
Can you try adding append to corresponding index
mylist[2][2].append(555)