Copy a string: Difference between revisions

Content added Content deleted
(Show how all copy operations return the same string)
(Actually copying a string)
Line 197: Line 197:
>>> src is a is b is c is d
>>> src is a is b is c is d
True
True
</pre>

To actually copy a string:

<pre>
>>> a = 'hello'
>>> b = ''.join(a)
>>> a == b
True
>>> b is a
False
</pre>
</pre>