0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AOJトライに関する知識知見の記録共有(Volume0-0029)

Last updated at Posted at 2021-10-03

概要

Volume0-0029 English Sentence

コード

from collections import Counter

def ret_words(str):
    ss = str.split(" ")
    cs = Counter(ss)
    ls = {w: len(w) for w in ss}
    return [cs, ls]

def hoge(*args):
    ret = []
    for arg in args:
        print(arg)
        ret.append(ret_words(arg))
    return ret

print(hoge(
"Thank you for your mail and your lectures"
))

実行結果

Thank you for your mail and your lectures
[[Counter({'your': 2, 'Thank': 1, 'you': 1, 'for': 1, 'mail': 1, 'and': 1, 'lectures': 1}), {'Thank': 5, 'you': 3, 'for': 3, 'your': 4, 'mail': 4, 'and': 3, 'lectures': 8}]]
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?