all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 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