PYTHON Count lines, words and characters in text file

preview_player
Показать описание
This is an awesome Python exercise on counting. It involves working with text files, counting lines, counting words and counting characters as well. But the coding part will be very simple.
=====================================
SUBSCRIBE FOR MORE:
=====================================
Рекомендации по теме
Комментарии
Автор

I have noticed that some people in the comments section who are copying the video type () instead of ( ). There is a difference and this may be why it is not working properly. The space in between the parentheses tell the program to look for all spaces. This is important because the computer recognizes words by the spaces in between them.

Lordratatosk
Автор

It might be a REAL GOOD IDEA to post the code

augiblutz
Автор

I wish i found this 2 hours ago! thank you!

alicewest
Автор

its great you can type that fast, but you should really slow down the video. Anyone looking at this with minimal experience in python would have to pause repeatedly to keep up

tothemax
Автор

Good 👍, I have also create a program to find out the words, vowel, character and space count in a sentence.

learngeek
Автор

I muted the video and played Dreamscape by 009 Sound System for nostalgia's sake

MMHD
Автор

help! 1 how do you solve this problem?
1. (70 points) In a university, students are categorized into four categories. A category of the following table:

Pension category
PENSION CATEGORY
A $ 550
B $ 500
C $ 460
D $ 400

Every six months, the university makes reductions in the pensions of its students to
Starting from the second cycle based on the average according to the following table:
Discount
AVERAGE% DISCOUNT
0 to 3.99 No discount
4 to 7.99 10%
8 to 10 15%

Design a program that determines and shows how much a student will receive a discount on their current pension and their next ancestry.

claudioolivera
Автор

how to count num
of files in a folder?

priyadavanageri
Автор

Bro it is very blured in 720p, plz tell me what I'd written after last line, print"lines:....? i\nWords

shubhamdubey
Автор

How to count number of char in csv file without for loop(my delimeter is, )

prashanabalaji
Автор

holy shit this is a very fucking informative video
I learned some very useful things. Thanks a lot.

sews
Автор

Would this work with a txt document that's in a browser? Like just read a URL that has the text laied out the same as a text document.

coolduder
Автор

Don't know how active you are now, but I got it to count the amount of words I have. But how do i get it to exclude counting symbols as words? Example, it counts ' - ' and ' -- ' as words.

Tharros
Автор

if the txt file is residing in a different drive and ur python file is sitting in a different location, how you will mention the txt file? should we give the fully qualified path, say

samolppp
Автор

how can i count digits from notepad files ?

-MrMohit
Автор

Which text editor are you using there? It looks nice to use...

benjaminrawson
Автор

Whats that character b4 i in the last line

vishalrasaily
Автор

how about blank lines if it have alot?

manhha
Автор

I can't read your code. Can you paste the text file?

michelehelm
Автор

I have what you have but am getting an output of just 0, even though I have a significant amount of characters (trying just characters first)...any help? I've never seen the += before, is that the same as another operation?

ColinTheBruce