Last active
December 11, 2015 14:38
Revisions
-
Sam Rudge revised this gist
Jan 23, 2013 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ def __init__(self): self.parseInput() def parseInput(self): counter = 0 while True: ip = raw_input('> ') @@ -13,12 +15,18 @@ def parseInput(self): 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() -
Sam Rudge revised this gist
Jan 23, 2013 . 1 changed file with 19 additions and 19 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,24 @@ import re class CapsTalk(object): def __init__(self): self.parseInput() def parseInput(self): while True: ip = raw_input('> ') out = "" ip = re.sub(r'[^a-zA-Z0-9]', '', ip) for i in range(0,len(ip)): if i%2 == 0: out += ip[i].lower() else: out += ip[i].upper() print out if __name__ == '__main__': CapsTalk() -
Sam Rudge created this gist
Jan 23, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ import re class CapsTalk(object): def __init__(self): self.parseInput() def parseInput(self): while True: ip = raw_input('> ') out = "" ip = re.sub(r'[^a-zA-Z0-9]', '', ip) for i in range(0,len(ip)): if i%2 == 0: out += ip[i].lower() else: out += ip[i].upper() print out if __name__ == '__main__': CapsTalk()