Python List Slicing Can Get Weird - Python Nested-List Copying Tutorial

preview_player
Показать описание
Python list slicing can get hard as you try to copy the values from one list to another list with nested lists. I came across this problem during another problem so I thought why not share it with everyone. In this python programming video, we will see how to copy a nested list in python.

...

...

Outro music:

#programming #tutorial #forbeginners #inhindi #python #list
Рекомендации по теме
Комментарии
Автор

Without doing this all, you can simply make a deep copy in this way: list2=copy.deepcopy(list1) # it will copy everything like the nested lost and all, and yeh of course you'll have to import copy for this to work.

Thank me later!

sharjeel_mazhar