Alan's answer to Roelof made me think...
On 08/10/2010 13.40, Francesco Loffredo wrote:
Il 08/10/2010 10.02, Alan Gauld ha scritto:
"Roelof Wobben" <rwob...@hotmail.com> wrote
I have this programm :
tournooi = [{'thuis': 'A','uit': "B",'thuisscore': 20, 'uitscore':
...
This was your answer to Roelof:
On the next iteration you overwrite those two dictionaries
with new values then append them to the list again.
So you wind up with 2 copies of the updated dictionaries.
...
This is difficult for me too: why does this happen? Or, more correctly,
why should this happen? How can you save the current contents of a
dictionary in a list, making sure that the saved values won't change if
you update the dict?
You tell Roelof that the dictionary must be created at every loop, but
if so, where goes the elegance of
myDictList.append(UpdateIt(myDict))
???
Francesco (puzzled)
Nessun virus nel messaggio in uscita.
Controllato da AVG - www.avg.com
Versione: 9.0.862 / Database dei virus: 271.1.1/3184 - Data di rilascio:
10/08/10 08:34:00
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor