On 06/10/11 08:15, Praveen Singh wrote:

CountWords("google")
[('e',1),('g',2),('l',1),('o',2)]

by the level of this question you can easily understand i am new in
python.the problem i am facing is how to make set of word and count(e,1)
and add this to list??

Some clues:

a for loop will iterate over a string:

for letter in "google":
    print letter


A dictionary holds a value against a key.
A key can be a letter. The corresponding value can be a number.


Does that help?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to