Hello,
I am new to python and i am having problems in the output format of "for" "in" loop
example the code below
# A word count programme
# Author why jay
def main():
import string
word=0
line=0
letters=0
asd=raw_input("Enter file here : ")
f_name=open(asd,'r')
for why in f_name:
see=why.split()
line=line+1
word=word+len(see)
letters=letters+len(why)
f_name.close()
print "Number of lines,words,letters is : " ,line,word,letters
main()
the above programme gives the output as thus:
Number of lines,words,letters is : 1 1 9
Number of lines,words,letters is : 2 2 16
Number of lines,words,letters is : 3 3 25
Number of lines,words,letters is : 4 4 36
Number of lines,words,letters is : 5 6 50
Number of lines,words,letters is : 6 7 56
Number of lines,words,letters is : 7 8 68
Number of lines,words,letters is : 8 9 75
Number of lines,words,letters is : 9 11 90
Number of lines,words,letters is : 10 12 101
Number of lines,words,letters is : 11 12 102
Number of lines,words,letters is : 12 13 106
Number of lines,words,letters is : 13 14 112
Number of lines,words,letters is : 14 15 128
please someone help me to output of the code as
Number of lines,words,letters is : 14 15 128
I would will be really gratefull if someone could help me.Thanks in advance