fork download
  1. def rotate_word(s, x):
  2. for l in s:
  3. n = ord(l)
  4. if n < 'n':
  5. n += x
  6. print(chr(n), end="")
  7. else:
  8. n -= x
  9. print(chr(n), end="")
  10.  
  11. rotate_word("sup dvach", 13)
Runtime error #stdin #stdout #stderr 0.03s 9984KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 11, in <module>
  File "./prog.py", line 4, in rotate_word
TypeError: unorderable types: int() < str()