Skip to content

Instantly share code, notes, and snippets.

@afzafri
Created May 30, 2017 15:23
Show Gist options
  • Save afzafri/53a95d167203348152a0887591a0b21e to your computer and use it in GitHub Desktop.
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.
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