Skip to content

Instantly share code, notes, and snippets.

@austlane
Created October 24, 2019 19:45
Show Gist options
  • Save austlane/f5261916db725358e3597e7ddf38c6fa to your computer and use it in GitHub Desktop.
Save austlane/f5261916db725358e3597e7ddf38c6fa to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys
iN_sTrInG = ' '.join(sys.argv[1:])
yEeT_sTrInG = ""
yEeT_sTaTe = False
for cHaRaCtEr in iN_sTrInG:
if cHaRaCtEr.isalpha():
if yEeT_sTaTe:
yEeT_sTrInG = yEeT_sTrInG + cHaRaCtEr.upper()
else:
yEeT_sTrInG = yEeT_sTrInG + cHaRaCtEr.lower()
yEeT_sTaTe = not yEeT_sTaTe
else:
yEeT_sTrInG = yEeT_sTrInG + cHaRaCtEr
print(yEeT_sTrInG)
@austlane
Copy link
Author

Austin.lane$ ./yEeT.pY Matt thinks I need help
mAtT tHiNkS i NeEd HeLp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment