fork download
  1. # http://c...content-available-to-author-only...e.com/a/94351/34718
  2.  
  3. for _ in range(7): # number of test cases
  4. s="\0%s\0"%input();r=''
  5. for i in range(len(s)-2):L,M,R=map(ord,s[i:i+3]);a=i%2and[R,L][M%2]|M or L|R;r+=chr(a*(a<127)or 32)
  6. print r
  7.  
Success #stdin #stdout 0s 9032KB
stdin
"hello"
"Hello, World!"
"PPCG"
"Programming Puzzles and Code Golf"
"abcdefghijklmnopqrstuvwxyz"
"!abcdefghijklmnopqrstuvwxyz"
"Test 123 with odd characters. R@*SKA0z8d862"
stdout
emmol
emmol, ww~ved
PSWG
r wogsmmoonpuu ~ meannncoooeggonl
bcfefgnijknmno~qrsvuvw~yzz
aaccgeggoikkomoo qsswuww yy
euutu133www|todddchizsscguwssr`jS{SK{z~|v66