Created
May 30, 2017 15:23
-
-
Save afzafri/53a95d167203348152a0887591a0b21e to your computer and use it in GitHub Desktop.
Mocking Spongebob text generator. Simple script to generate alternating uppercase and lowercase text.
This file contains hidden or 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
import sys | |
if len(sys.argv) < 2: | |
print "Usage: python mocking.py <text>" | |
else: | |
text = str(sys.argv[1]).lower() | |
for i in range(len(text)): | |
sys.stdout.write((i%2==0) and text[i].upper() or text[i]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment