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):
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:
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 code:
def
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 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:
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)
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 %(number)
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 % (index, word)