Solve word counts (equivalent to paiza rank C) in Python

at first

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.

problem

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.

Answer code

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)

reference

https://qiita.com/KoyanagiHitoshi/items/3286fbc65d56dd67737c

Finally

Feel free to comment if you have any questions. I will answer as much as possible!

Recommended Posts

Solve word counts (equivalent to paiza rank C) in Python
Solve Fizz Buzz (equivalent to paiza rank C) in Python
Solve addition (equivalent to paiza rank D) in Python
Solve multiplication (equivalent to paiza rank D) in Python
[With commentary] Solve Fizz Buzz (equivalent to paiza rank C) in Python
Solve number sorting (equivalent to paiza rank D) in Python
Solve character matches (equivalent to paiza rank D) in Python
Solve mod7 fortune-telling (equivalent to paiza rank S) in Python
Solve the smallest value in Python (equivalent to paiza rank D)
Solve ABC036 A ~ C in Python
How to wrap C in Python
Solve ABC037 A ~ C in Python
Solve word counts (equivalent to paiza rank C) in Python
Solve Fizz Buzz (equivalent to paiza rank C) in Python
Paiza Skill Check List of Frequently Used D and C Ranks ~ Python ~
[With commentary] Solve Fizz Buzz (equivalent to paiza rank C) in Python
Solve ABC175 A, B, C in Python
Module to generate word N-gram in Python
I wanted to solve ABC159 in Python
How to use the C library in Python
Solve ABC168D in Python
Solve ABC167-D in Python
Next Python in C
Solve ABC098-C in Python
Solve ABC159-D in Python
Solve ABC169 in Python
C API in Python 3
Solve ABC160-E in Python
Try to make a Python module in C language
Solve Atcoder ABC176 (A, B, C, E) in Python
To do the equivalent of Ruby's ObjectSpace._id2ref in Python
Extend python in C ++ (Boost.NumPy)
To flush stdout in Python
Login to website in Python
Solve ABC176 E in Python
Solve Wooldridge exercises in Python
Binary search in Python / C ++
Solve ABC175 D in Python
Speech to speech in python [text to speech]
Object-oriented in C: Refactored "○ ✕ game" and ported it to Python
13th Offline Real-time How to Solve Writing Problems in Python
Solve optimization problems in Python
How to develop in Python
Post to Slack in Python
I want to solve APG4b with Python (only 4.01 and 4.04 in Chapter 4)
The 17th Offline Real-time How to Solve Writing Problems in Python
How to write offline real time Solve E04 problems in Python
[Python] How to do PCA in Python
Convert markdown to PDF in Python
How to use SQLite in Python
ABC166 in Python A ~ C problem
Solve Atcoder ABC169 A-D in Python
In the python command python points to python3.8
Introduction to Protobuf-c (C language ⇔ Python)
Try to calculate Trace in Python
Solve ABC168 A ~ C with Python
How to use Mysql in python
How to use ChemSpider in Python
6 ways to string objects in Python
How to use PubChem in Python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
Solve ABC158 A ~ C with Python
Solve ordinary differential equations in Python