Python Exercise Example 7
**Problem:** Copy the data of one list into another list.
**Program Analysis:** Use list [:].
Program source code:
Example
#!/usr/bin/python
-- coding: UTF-8 --
a
=
[
1
,
2
,
3
]
b
=
a
[
:
]
(
b
)
The output of the above example is:
[1, 2, 3]
Python 100 Examples