You are viewing a single comment's thread. Return to all comments →
def encryption(s): s = s.replace(' ', '') sqr = len(s)**(1/2) rows, cols = round(sqr), math.ceil(sqr) grid = [] ptr = 0 for i in range(rows): grid.append(s[ptr: ptr+cols]) ptr += cols output = [] for i in range(cols): word = '' for j in range(rows): try: word += grid[j][i] except Exception: continue output.append(word) return ' '.join(output)
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 →
In Python3