Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,12 @@
|
|||
def chain_insert(lst, at, item):
|
||||
while lst is not None:
|
||||
if lst[0] == at:
|
||||
lst[1] = [item, lst[1]]
|
||||
return
|
||||
else:
|
||||
lst = lst[1]
|
||||
raise ValueError(str(at) + " not found")
|
||||
|
||||
chain = ['A', ['B', None]]
|
||||
chain_insert(chain, 'A', 'C')
|
||||
print chain
|
||||
|
|
@ -0,0 +1 @@
|
|||
['A', ['C', ['B', None]]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue