Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add value into sub-list

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]

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Can you try adding append to corresponding index
mylist[2][2].append(555)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading