Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save nozma/e3f8bb42139c6d20f357a3df679ae851 to your computer and use it in GitHub Desktop.
# coding: utf-8
s = 'Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.'
# 単語毎のリストに分解してから,.を除外し文字数をカウント
result = [len(w.rstrip(',.')) for w in s.split()]
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment