Other articles


  1. Rotate arbitrary

    Another way to rotate by arbitrary values.

    You can in python 2.x - just str.encode(“rot13”) - but for other rotations you could use the following (for ascii):

    from string import ascii_uppercase as uc, ascii_lowercase as lc, maketrans
    
    letters = uc + lc
    rotate = 17 # ROT17
    rot = "".join((x[:rotate][::-1] + x ...
    read more

    There are comments.

  2. Page 1 / 1

blogroll

social