Returning dictionary from a function

smarden1 at smarden1 at
Thu May 14 18:03:43 EDT 2009

def values(x):
    for a in range(x):
        diky[chr(a)] = a
    return diky

it is not working b/c you are creating a new dictionary with each
iteration of the loop, rather you want to update the same dictionary
with the new value you have..

More information about the Python-list mailing list