Sorry I am completely new at python and don't understand why this function is 
returning an empty dictionary. I want it to take a list of files open them then 
return the number of characters as the value and the file name as the key. 
def fileLengths(files):    d = {}    files = []    for file in files:        
reader = open(file)        for line in reader:            char = sum(len(line)) 
       d[file] = char        reader.close    return d
Thank you sorry I don't understand what I am doing wrong. 
-Clara                                    
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to