diff options
author | standenboy <standenboy@seacrossedlovers.xyz> | 2023-12-15 10:19:20 +0000 |
---|---|---|
committer | standenboy <standenboy@seacrossedlovers.xyz> | 2023-12-15 10:19:20 +0000 |
commit | 4a95719d58a708ad55b1389631d6339047f786a0 (patch) | |
tree | 26cb6fc2dbe7fa75f57f1d6fb13aff8955772b56 /comp/work/10/railfence.py |
added existing work
Diffstat (limited to 'comp/work/10/railfence.py')
-rwxr-xr-x | comp/work/10/railfence.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/comp/work/10/railfence.py b/comp/work/10/railfence.py new file mode 100755 index 0000000..c91d491 --- /dev/null +++ b/comp/work/10/railfence.py @@ -0,0 +1,19 @@ +string = "HELLO_THERE" +shift = 4 +hidden = [] +tmp = "" +for i in string: + if len(tmp) + 1 > shift: + hidden.append(tmp) + tmp = "" + tmp = tmp + i +if len(tmp) != 0: + hidden.append(tmp) +final = [] +for i in range(shift): + for j in hidden: + try: + final.append(j[i]) + except: + pass +print(final) |