Skip to content

Instantly share code, notes, and snippets.

@nozma
Last active August 16, 2017 13:15
Show Gist options
  • Select an option

  • Save nozma/490329f040b7d4a35541049b3af1d0fd to your computer and use it in GitHub Desktop.

Select an option

Save nozma/490329f040b7d4a35541049b3af1d0fd to your computer and use it in GitHub Desktop.
# coding: utf-8
import re
s = input()
# カンマとコンマを除外してから単語毎のリストに分解
s = re.sub('[,.]', '', s)
s = s.split()
# 文字数をカウントしてリスト化
result = []
for w in s:
result.append(len(w))
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment