• + 0 comments

    using nested loop in python:

    def encryption(s): row, column = math.floor(math.sqrt(len(s))) , math.ceil(math.sqrt(len(s))) str = '' for x in range(column): for y in range(x, len(s), column): str = str + s[y] str = str + ' ' return str