#rotate 90 deg clockwise box=[["a","b"],["c","d"],["e","f"]] rows = len(box) cols = len(box[0]) box2 = [[""] * rows for _ in range(cols)] for x in range(rows): for y in range(cols): box2[y][rows - x - 1] = box[x][y]