fork(1) download
  1. # http://c...content-available-to-author-only...e.com/a/55082/34718
  2. # Author: mbomb007
  3.  
  4. I,c=input()
  5. I+=(c-len(I)%c)*" "
  6. L=[]
  7. i=0
  8. while I:s=I[:c];L+=[[s,s[::-1]][i%2]];i+=1;I=I[c:]
  9. print"\n".join(L)
Success #stdin #stdout 0.02s 9024KB
stdin
"Hello, World!", 5
stdout
Hello, World! 5
Hello
roW ,
ld!