Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- s = "Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics."
- """
- re.sub(pattern, repl, string, count=0, flags=0)
- """
- s = re.sub(r'[,.]', '', s)
- s_list = s.split()
- answer = []
- #文字数をカウントし出現順に配列に格納してるとこ
- for n in s_list:
- answer.append(len(n))
- print(answer)
Add Comment
Please, Sign In to add comment