Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # var_copy.py
- import copy
- class number():
- def __init__(self, name, number):
- self.name = name
- self.number = number
- c = number(1, "one")
- d = c
- e = copy.copy(c)
- print(c.number, d.number, e.number)
- d.number = 2
- e.number = 5
- print(c.number, d.number, e.number)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement