I was solving a collection of paiza level-up questions, but I didn't have a model answer, so I made it myself. The language is Python3.
Paiza's skill check sample question Word count (equivalent to paiza rank C) https://paiza.jp/works/mondai/skillcheck_sample/word-count?language_uid=python3 I couldn't see the problem statement without logging in. Registration is free and can be done immediately, so I recommend you to register for the time being.
sort-number.py
s = input().split()
word_list = []
for word in s:
if not word in word_list:
print(word, s.count(word))
word_list.append(word)
https://qiita.com/KoyanagiHitoshi/items/3286fbc65d56dd67737c
Feel free to comment if you have any questions. I will answer as much as possible!
Recommended Posts