Can any body help me

Fredrik Lundh fredrik at pythonware.com
Fri May 26 05:13:24 EDT 2006


Sidd wrote:

> 1.Given a test file containing lines of words such as (abc, abb,
> abd,abb, etc), write a script that prints, in order of frequency, how
> many times each word appears in the file.
> 
> Use dictionary datastructure in python and simple if-else statement.
> Its simple give it a try.

so what are you waiting for? ;-)

(don't you think asking a mailing list for help with homework might be 
considered cheating?

asking for help in figuring out why your attempt doesn't work might be 
okay, but asking someone else to write the code for you is a bit, well...

I suggest starting out by looking at the relevant sections in the 
tutorial; dictionaries are discussed in the "data structures" chapter, 
and how to read stuff from files is discussed in the "input and output 
chapter". you can find the tutorial here:

     http://docs.python.org/tut/

)

</F>




More information about the Python-list mailing list