【python】自然言語処理100本ノックやってみた!【03本目】
演習問題が載っているサイトはこちらです!
03. 円周率
"Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics."という文を単語に分解し,各単語の(アルファベットの)文字数を先頭から出現順に並べたリストを作成せよ.
sentence="Now I need a drink, alcoholic of course, after the heavy lectures involving quantum mechanics." s_list=sentence.replace(",","").replace(".","").split() count_list=[] for i in range(len(s_list)): count_list.append(len(s_list[i])) print(count_list)
04本目
【python】自然言語処理100本ノックやってみた!【04本目】 - はむーずぶろぐ
第1章まとめ