[Tutor] Hi everybody stuck on some error need help please thank you!!
Steven D'Aprano
steve at pearwood.info
Sat Apr 24 07:01:45 CEST 2010
On Sat, 24 Apr 2010 01:33:46 pm Marco Rompré wrote:
> I tried to enter model = Modele (nom_fichier) but it still does not
> work.
What does "still does not work" mean?
Please copy and paste the error you get.
> And for the list I don't understand very well,
Open an interactive session and do some experiments.
>>> a = [] # One empty list.
>>> b = [] # A different empty list.
>>> a.append(1) # Appends to the first list.
>>> print a, b
[1] []
>>>
>>> a = [] # An empty list.
>>> b = a # The SAME empty list.
>>> a.append(1)
>>> print a, b
[1] [1]
When you have a default value like magasins=[], it is like the second,
not the first.
--
Steven D'Aprano
More information about the Tutor
mailing list