Counting

Steve Holden steve at holdenweb.com
Fri May 4 22:32:40 EDT 2007


James Stroud wrote:
> James Stroud wrote:
>> James Stroud wrote:
[finally ...]
> 
> I should really wait until I've had some coffee. Not continue, but break!
> 
> 
> for i,line in enumerate(linelist):
>    line = line.split()
>    for k in line:
>      if keyword.iskeyword(k):
>        total += line.count(k)
>        print "The word '%s' belongs in line num: %d" % (k, i+1)
>        break
> 
> print "Total keyords are: %d" % total

James is actually trying to convince you of the merits of test-driven 
development by cleverly showing you the disadvantages of not using it.

Clever approach to advocacy, James. Did you get your coffee yet?

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com        squidoo.com/pythonology
tagged items:         del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------




More information about the Python-list mailing list