fork download
  1. def zigzag(msg:str):
  2. zig = msg[::2]
  3. zag = msg[1::2]
  4. print(' '.join(zig))
  5. print(' ' + ' '.join(zag))
  6.  
  7. zigzag('123456789')
  8. zigzag('The earth turns around the sun.')
  9.  
Success #stdin #stdout 0.04s 9440KB
stdin
Standard input is empty
stdout
1 3 5 7 9
 2 4 6 8
T e e r h t r s a o n   h   u .
 h   a t   u n   r u d t e s n