Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kenichi-fukushima/a82160f4aa2b1acc183b to your computer and use it in GitHub Desktop.
Save kenichi-fukushima/a82160f4aa2b1acc183b to your computer and use it in GitHub Desktop.
import re
import sys
def ToScreamingSnakeCase(s):
return '_'.join([m.group().upper() for m in re.finditer(r'[A-Z][a-z]*', s)])
for line in sys.stdin:
print ToScreamingSnakeCase(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment