Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16714

How can I copy a entire list in python without deepcopy?

$
0
0

guys. I need to copy a list in python, however, I can only use for loop, in addition, it is forbidden special functions like deepcopy, also tuples, stacks, lambda, etc. Only FOR and simple python stuff

This is a example of the list: [2,[2,[8,7,[7,[4,5,8]],5],9,[]]]

I tried to create an auxiliary function with variables and loops, but I can’t stop the new list from sharing memory space with the original.


Viewing all articles
Browse latest Browse all 16714

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>