I'm working on a homework assignment and I'm running into a weird issue with python I don't quite understand. I am creating an abacus based on some input number and to do this I created a base abacus or an "empty" abacus representing 0 as a global variable. In my function I set the new_abacus value equal to the empty_abacus global variable; but for some reason when I change the new_abacus variable the empty_abacus variable also changes.
Inside my function:
def function(input_num):
global empty_abacus
new_abacus = empty_abacus
#I then change the new_abacus variable
return new_abacus
When I try printing out empty_abacus after using this function it has been changed. I assume this is some weird thing with global variable in pythons. How can I prevent empty_abacus from being changed when I change new_abacus. Or in other words, how can I assign new_abacus the value of empty_abacus; rather than a reference.
Note: empty_abacus is a 2-dimensional list
EDIT: I apologize if the title is misleading, I'm not sure how to put it in words.