Created
October 10, 2016 22:00
-
-
Save mei-li/bb52e6ab623c77c8e9f9c3e891675618 to your computer and use it in GitHub Desktop.
Create hidden message in lowercase.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create hidden message in lowercase. | |
""" | |
import string | |
import random | |
def random_text(size): | |
chars = string.ascii_uppercase + string.ascii_lowercase + string.punctuation + string.digits | |
return ''.join([random.choice(chars) for i in xrange(size)]) | |
def riddleit(secret): | |
message = [] | |
secret = ''.join(secret.split()).lower() | |
for ch in secret: | |
message.append(random_text(random.randint(100, 400)).upper()) | |
message.append(ch) | |
message.append(random_text(random.randint(100, 400)).upper()) | |
return ''.join(message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment