On 04/24/2013 06:58 PM, Oscar Benjamin wrote:
On 24 April 2013 23:41, Alan Gauld <alan.ga...@btinternet.com> wrote:
On 24/04/13 20:32, Oscar Benjamin wrote:
On 24 April 2013 20:07, Alan Gauld <alan.ga...@btinternet.com> wrote:
On 24/04/13 16:52, Dave Angel wrote:
Does it mean? ; totalViruses[i] = totalViruses[i]/float(numTrials)
As the others have said, that's exactly right, at least if
totalViruses[i] is immutable, like an int or a float.
What difference does immutability make here?
Thanks for your help Oscar. I was trying to keep it simple for a
beginner. So I deliberately did not elaborate on the exception. But
the one I had in mind was the behavior of a list, when += is used.
a = [1,2,3]
b = a
b += [4] versus b = b + [4]
The former would change a, while the latter would not.
If += were a literal substitution, like a macro, then this distinction
could not happen.
So all I said was for immutables (and int and float are immutable), the
statement was true.
--
DaveA
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor