RosettaCodeData/Task/Copy-a-string/Python/copy-a-string-1.py
2023-07-01 13:44:08 -04:00

8 lines
144 B
Python

>>> src = "hello"
>>> a = src
>>> b = src[:]
>>> import copy
>>> c = copy.copy(src)
>>> d = copy.deepcopy(src)
>>> src is a is b is c is d
True