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

9 lines
144 B
Python
Raw Permalink Normal View History

2013-04-10 23:57:08 -07: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