Created
December 4, 2020 23:08
-
-
Save craigcalef/0c5d1857da2ed1f6d8975aa4f1e68fce to your computer and use it in GitHub Desktop.
spengbob.py
This file contains 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
>>> def spengbob(s): | |
... return "".join([c.lower() if i % 2 == 0 else c.upper() for i, c in enumerate(s)]) | |
... | |
>>> spengbob("massachusetts") | |
'mAsSaChUsEtTs' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment