Masala #KCEUKPNS0Y
Xotira 32 MB
Vaqt 1000 ms
14
So'zlar sanash
Sizga bir matn beriladi siz uni ichidagi so'zlar nechtaligi bilan ularni taxlang.
Kiruvchi ma'lumotlar:
Matn uzunligi 100 dan oshmaydi!
Chiquvchi ma'lumotlar:
Javobni har bir qotorda so'z va nechtaligi bilan chiqaring.
Misollar
# | input.txt | output.txt |
---|---|---|
1 |
Hello world! Welcome to the world of Python. Python is great for data analysis. Hello again! |
hello: 2 world: 2 python: 2 welcome: 1 to: 1 the: 1 of: 1 is: 1 great: 1 for: 1 data: 1 analysis: 1 again: 1 |
Izoh:
so'zlarni space va belgilarga ajrating: belgilar, sonlar, qavslar, amallar. So'zlar ko'pligi bo'yicha tartiblab chop eting!
Maslahat: from collections import Counter