Copy with Different Memory Address - Python
Question: I made a class object I'll call Node.

I want to make a copy of an instance of this object. Let's say the original is
named "root" and the copy is to be named "start"

If I do start = root.

When I make any changes to start, it also changes root. This is because they
share a memory address.

How can I make start = root with different memory address?

I tried messing around with copy/deepcopy after some searching but it tells me
there is no such attribute.

Is there an easy way to do this?

Thanks!


Answer: I've solved this problem using deepcopy from the lib copy. In my case I had
other objects within the object I wanted to duplicate, so I had to use
deepcopy otherwise just copy would have solved the problem. Take a look at the
lib's documentation (<https://docs.python.org/2/library/copy.html>)

Remember:

    
    
    import copy
    start = copy.deepcopy(root)
    

