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"))
  9. print(szyfr("szyfrowanie jest trudne"))
Success #stdin #stdout 0.07s 14080KB
stdin
Standard input is empty
stdout
okwtcia
zsfyorawin eejtst urnde