diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-17 03:38:29 +0200 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-17 03:38:29 +0200 |
| commit | 700f8d7605b823accd293f51c2bed53438ac22ac (patch) | |
| tree | 8b01a86576e83c5e088c60949968d99a59e8c711 /code-examples.py | |
| download | linkeysearch-700f8d7605b823accd293f51c2bed53438ac22ac.tar.gz linkeysearch-700f8d7605b823accd293f51c2bed53438ac22ac.tar.bz2 linkeysearch-700f8d7605b823accd293f51c2bed53438ac22ac.zip | |
Initial commit
Diffstat (limited to 'code-examples.py')
| -rw-r--r-- | code-examples.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/code-examples.py b/code-examples.py new file mode 100644 index 0000000..d8d0042 --- /dev/null +++ b/code-examples.py @@ -0,0 +1,24 @@ +# test +a = 1 +b = 4 + +def addto(x, l) : + l.append({ + "n" : x, + "c": [] + }) + for it in l : + if it["n"] == 4 : + subl = it["c"] + subl.append(x) + it['c'] = subl + + +malist = [] + +malist.append({ "n" : a }) +print(malist) + +addto(b, malist) +addto(b, malist) +print(malist) |
