RosettaCodeData/Task/Copy-a-string/Python/copy-a-string-1.py

9 lines
144 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
>>> 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