Last active
July 2, 2019 17:01
-
-
Save tlancon/c70fad5023243f36db232a86b5448b7e to your computer and use it in GitHub Desktop.
Make any string sarcastic!
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 sarcastify(my_string): | |
""" | |
Returns a sarcastic version of the provided string. | |
Example: | |
>>> sarcastify('Do you really think that\'s a good idea?') | |
"dO YoU ReAlLy tHiNk tHaT'S A GoOd iDeA?" | |
Useful for arguing online or replying all to that email that accidentally | |
went to the whole company. | |
""" | |
a = my_string[0::2].lower() | |
b = (my_string[1::2]+' ').upper() | |
mY_StRiNg = ''.join([i+j for i,j in zip(a,b)]).strip() | |
return mY_StRiNg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment