fork download
  1. def szyfr(s):
  2. t=""
  3. for i in range(0, len(s)-1, 2):
  4. t = t + s[i+1] + s[i]
  5. if len(s)%2 != 0:
  6. t=t + s[len(s)-1]
  7. return t
  8. print(szyfr("kotwica"))
Success #stdin #stdout 0.09s 14112KB
stdin
Standard input is empty
stdout
okwtcia