Συντονιστής: konnn

έγραψε:>>> a = ["o","b","k"]
>>> a
['o', 'b', 'k']
>>> a = list()
>>> a
[]

alist = range(10)
alist = []
In [1]: alist = range(10)
In [2]: id(alist)
Out[2]: 26002640
In [3]: alist = []
In [4]: id(alist)
Out[4]: 26002928
In [5]: alist = range(10)
In [6]: id(alist)
Out[6]: 28160440
In [7]: for i in range(len(alist)):
...: alist.pop()
...:
In [8]: id(alist)
Out[8]: 28160440

In [11]: alist = range(10)
In [12]: for item in alist:
....: del item
....:
In [13]: alist
Out[13]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]


έγραψε:>>> a = list("abcdefghijkl")
>>> a
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']
>>> a.pop() # Remove last
'l'
>>> a
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']
>>> a.pop(1) # Remove item with id 1 (second in row)
'b'
>>> a
['a', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']
>>> a.pop(a.index("e")) # Remove item "e" (through index/id)
'e'
>>> a
['a', 'c', 'd', 'f', 'g', 'h', 'i', 'j', 'k']
έγραψε:να σου πω, το id τι ρολο βαραει;


Traceback (most recent call last):
File "./vault.py", line 161, in create_folder
existing_folders = pickle.load(f)
File "/usr/lib/python2.7/pickle.py", line 1378, in load
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib/python2.7/pickle.py", line 880, in load_eof
raise EOFError
EOFError

