Python Exercise Example 7
Topic: Copying data from one list to another list.
Program analysis: using the list [:].
Source Code:
#!/usr/bin/python # -*- coding: UTF-8 -*- a = [1, 2, 3] b = a[:] print b
The above example output is:
[1, 2, 3]
Topic: Copying data from one list to another list.
Program analysis: using the list [:].
Source Code:
#!/usr/bin/python # -*- coding: UTF-8 -*- a = [1, 2, 3] b = a[:] print b
The above example output is:
[1, 2, 3]