Комментарии:
I wish i found this 2 hours ago! thank you!
ОтветитьIt might be a REAL GOOD IDEA to post the code
ОтветитьBro it is very blured in 720p, plz tell me what I'd written after last line, print"lines:....? i\nWords
ОтветитьHow to count number of char in csv file without for loop(my delimeter is ,)
ОтветитьThank you bro
Ответить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 D:\testing0410\mytextfile1.txt
Ответитьhow can i count digits from notepad files ?
ОтветитьGood 👍, I have also create a program to find out the words, vowel, character and space count in a sentence.
ОтветитьThanks useful thing.
ОтветитьWhats that character b4 i in the last line
Ответить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.
Ответитьhow do i use this to find paragraphs
Ответить//this is no java for using // for comments hahahah (I usually made the same mistake)
Ответитьwhat soundtrack is this? its nice
Ответитьholy shit this is a very fucking informative video
I learned some very useful things. Thanks a lot.
why num_lines += 1
Ответитьyou are typing away with out explanation in most lines. NOT COOL ! it does not help.
Ответитьmusic name please!
Ответитьhello sir,
please make video with audio so we can get better explaination of program,,only seeing codes means that we get it from goolge search also.
music is rad
ОтветитьI can't read your code. Can you paste the text file?
ОтветитьI muted the video and played Dreamscape by 009 Sound System for nostalgia's sake
Ответить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.
Ответитьcould you comment the code as text please so I can copy and paste it
Ответить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.
how to count num
of files in a folder?
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
Ответитьwhat is the "with" function???
Ответитьhow about blank lines if it have alot?
ОтветитьBetter than Idle?
ОтветитьWhich text editor are you using there? It looks nice to use...
Ответить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.
ОтветитьNice video. You may also want to checkout the review of count lines on my blog at edwinreviews. com/count-lines-review/ Thanks, Calvin.
Ответитьdef main():
fname = input("Enter filename: ")
infile=open(fname)
numLines = numWords = numChars = 0
for line in infile:
words = line.split()
numLines += 1 - line.count(' ')
numWords += len(words)
numChars += len(line) - line.count(' ')
print("Lines: ", numLines)
print("Words: ", numWords)
print("Characters: ", numChars)
main()
So I've got everything working with what I have above but one of the requirements is to count characters excluding spaces (same for blank lines, but that's working) but for some reason the character count is higher than the number of characters in my .txt file.
File:
black
blue green
pink
yellow orange
1234
4321
It is giving me a count of 46, even though there's clearly less than that...any help would be great!
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?
ОтветитьThe video was extremely fast but thanks. :)
Ответитьcool thx ;)
Ответить