Skip to content

Instantly share code, notes, and snippets.

@capttwinky
Created August 9, 2011 19:53
Show Gist options
  • Save capttwinky/1135021 to your computer and use it in GitHub Desktop.
Save capttwinky/1135021 to your computer and use it in GitHub Desktop.
class myStr(str):
def pogoCase(self,jumpInt):
return "".join([myCar.lower() if myInt % jumpInt else myCar.upper() for myInt, myCar in enumerate(self)])
thisThing = myStr("The quick brown fox jumped over the lazy dog.")
print thisThing
print thisThing.pogoCase(3)
print thisThing.pogoCase(2)
print type(thisThing) is str
print isinstance(thisThing, str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment