Created
August 12, 2020 13:38
-
-
Save jlamoree/160d4208e8b999050eb4b72e5cb896f0 to your computer and use it in GitHub Desktop.
Randomize character case
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
#!/usr/bin/env python | |
import random | |
import sys | |
o = "" | |
for c in sys.stdin.read(): | |
if c.isalpha(): | |
o += c.upper() if random.random() > 0.5 else c.lower() | |
else: | |
o += c | |
print(o) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment