You are viewing a single comment's thread. Return to all comments →
from math import sqrt from math import floor from math import ceil def encryption(s): s = s.replace(" ", "") len_s = len(s) L = sqrt(len_s) r = floor(L) c = ceil(L) first = [] for i in range(r+1): try: first.append(s[:c]) s = s[c:] except: pass count = 0 string = "" final = [] for i in range(c): for i in first: try: string += i[count] except: pass count += 1 final.append(string) string = "" return ' '.join(final)
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →