On Tue, 07 Jul 2009 00:29:36 +0100, Nile <[email protected]> wrote:
Revised code
for x in range(len(file_list)):
d = open(file_list[x] , "r")
data = d.readlines()
k = 0
k = above_or_below(data)
print "here is the value that was returned ",k
hashtable[k] = hashtable.get(k,0) + 1
hashtable_list = hashtable.values()
print "here is a list of the dictionary values ", hashtable_list
print "the length of the dictionary is ", len(hashtable)
Output
# The first 3 lines are printed from the function
# right before the return statement. This output
# snippet shows the last two stocks. The function
# SAYS it is returning the correct value but only
# the last date seems to make it to the hashtable
Function will return k which = 11/11/2008
Function will return k which = 11/12/2008
Function will return k which = 11/14/2008
Have you checked the indentation of the print statement
that produces this? Is it perhaps inside a loop still?
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list