Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from copy import copy
- from math import ceil
- a = input()
- while a != "0":
- p = list(map(int, a.split()))
- n = p[0]
- p = p[1:]
- s = input()
- s += " "*max(0, len(p)-len(s))
- l = list(s)
- spl = [l[i*len(p):i*len(p)+len(p)] for i in range(ceil(len(l)/len(p)))]
- if len(spl[-1]) < len(spl[0]):
- spl[len(spl)-1] += " "*(len(spl[0])-len(spl[-1]))
- nspl = [[" " for j in range(len(p))] for i in range(ceil(len(l)/len(p)))]
- for i in range(len(spl)):
- for j in range(len(p)):
- nspl[i][j] = copy(spl[i][p[j]-1])
- ans = "'"
- for i in nspl:
- ans += "".join(i)
- ans += "'"
- print(ans)
- a = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement