Last active
May 27, 2019 11:02
-
-
Save niranjrajasekaran/825c49be54ebda35d3f655e497121455 to your computer and use it in GitHub Desktop.
Method to write data to python list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: l = list() | |
In [2]: type(l) | |
Out[2]: list | |
In [3]: l | |
Out[3]: [] | |
In [4]: l.append(10) | |
In [5]: l.append('python-list') | |
In [6]: l | |
Out[6]: [10, 'python-list'] | |
In [7]: old_list = [1, 2, 3, 4, 5] | |
In [8]: l.extend(old_list) | |
In [9]: l | |
Out[9]: [10, 'python-list', 1, 2, 3, 4, 5] | |
In [10]: l.append(old_list) | |
In [11]: l | |
Out[11]: [10, 'python-list', 1, 2, 3, 4, 5, [1, 2, 3, 4, 5]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment