Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # coding: utf-8
  2. s = 'Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.'
  3.  
  4. # 単語毎のリストに分解してから,.を除外し文字数をカウント
  5. result = [len(w.rstrip(',.')) for w in s.split()]
  6.  
  7. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement