Created
January 16, 2019 12:43
-
-
Save pandanote-info/faf31fcbf356a0b40a53acfe46975be6 to your computer and use it in GitHub Desktop.
標準入力から読み込んだ文字列にCamelCase変換を行って標準出力にその結果を出力するプログラム。ラムダ式を使ってみた。
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
#!/usr/bin/env python3 | |
import io | |
import sys | |
import re | |
sys.stdin = io.TextIOWrapper(sys.stdin.buffer,encoding='utf-8') | |
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8') | |
for x in sys.stdin: | |
print(re.sub(r' (.)',lambda m: m.group(1).upper(),x),end='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment