Python exercise 1: Count number of words in a text file.

preview_player
Показать описание
We should write this program in 3 steps.
Steps 1 :
We can open the file in a read-only mode and store this information in a file variable,
Steps 2:
read() is used to read the entire data in one go and store it in a variable named read_data.
Steps 3:
split() method is used to split each sentence in read_data and all this information is stored in a variable named per_word.
Рекомендации по теме
Комментарии
Автор

If I want unique words that time what should I do.

bhavana-uz
join shbcf.ru