#!/usr/bin/env python # rot47.py # http://rot47.net # http://codingforspeed.com # https://helloacm.com def rot47(s): x = [] for i in xrange(len(s)): j = ord(s[i]) if j >= 33 and j <= 126: x.append(chr(33 + ((j + 14) % 94))) else: x.append(s[i]) return ''.join(x)