Skip to content

Instantly share code, notes, and snippets.

@YoSmudge
Last active December 11, 2015 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YoSmudge/4614955 to your computer and use it in GitHub Desktop.
Save YoSmudge/4614955 to your computer and use it in GitHub Desktop.
import re
class CapsTalk(object):
def __init__(self):
self.parseInput()
def parseInput(self):
counter = 0
while True:
ip = raw_input('> ')
out = ""
ip = re.sub(r'[^a-zA-Z0-9]', '', ip)
for i in range(0,len(ip)):
if counter%2 == 0:
out += ip[i].lower()
else:
out += ip[i].upper()
counter += 1
print out
#If counter is even it can be reset
if counter%2 == 0:
counter = 0
if __name__ == '__main__':
CapsTalk()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment