On Sun, 17 Dec 2006 17:00:46 +0100, Juho Schultz <[EMAIL PROTECTED]>
wrote:
> vertigo wrote:
>> > Perhaps you meant something more along the lines of this:
>> >
>> def PrintWordCountFloat(words):
>> >number = 0
>> >for index, word in enumerate(words):
>> >print "%s %f" %
vertigo wrote:
> > Perhaps you meant something more along the lines of this:
> >
> def PrintWordCountFloat(words):
> > number = 0
> > for index, word in enumerate(words):
> > print "%s %f" % (index, word)
> > number = number + 1
> > print "Total words: %d" %
> Perhaps you meant something more along the lines of this:
>
def PrintWordCountFloat(words):
> number = 0
> for index, word in enumerate(words):
> print "%s %f" % (index, word)
> number = number + 1
> print "Total words: %d" %(number)
PrintW
vertigo wrote:
> I receive such error:
> File "p4.py", line 24, in PrintWordCountFloat
> print "%s %f" % (word,words[word])
> TypeError: list indices must be integers
please post the *entire* traceback message. see:
http://effbot.org/pyfaq/tutor-i-need-help-im-getting-an-error-in-my-progra
vertigo wrote:
> I receive such error:
> File "p4.py", line 24, in PrintWordCountFloat
> print "%s %f" % (word,words[word])
> TypeError: list indices must be integers
>
> i call PrintWordCountFloat with hash table, keys are words(string) and
> values float.
> This part of the code:
>
> def
vertigo schrieb:
>
> Hello
>
> I receive such error:
> File "p4.py", line 24, in PrintWordCountFloat
> print "%s %f" % (word,words[word])
> TypeError: list indices must be integers
>
> i call PrintWordCountFloat with hash table, keys are words(string) and
> values float.
> This part of the
vertigo wrote:
> Hello
>
> I receive such error:
> File "p4.py", line 24, in PrintWordCountFloat
> print "%s %f" % (word,words[word])
> TypeError: list indices must be integers
>
> i call PrintWordCountFloat with hash table, keys are words(string) and
> values float.
> This part of the code:
Hello
I receive such error:
File "p4.py", line 24, in PrintWordCountFloat
print "%s %f" % (word,words[word])
TypeError: list indices must be integers
i call PrintWordCountFloat with hash table, keys are words(string) and
values float.
This part of the code:
def PrintWordCountFloat(words)