On Wed, 2009-07-01 at 16:44 +0100, Angus Rodgers wrote: > Hello, world! > > This is my first post to the Tutor list (although I've already > posted to comp.lang.python a couple of times). > > I'm currently reading Chapter 4 of Wesley Chun's book, "Core > Python Programming" (2nd ed.). > > I find this, in Python 2.5.4, on my Win98SE system (using IDLE): > > >>> n = "colourless" > >>> o = "colourless" > >>> n == o > True > >>> n is o > True > >>> p = "green ideas" > >>> q = "green ideas" > >>> p == q > True > >>> p is q > False > > Why the difference?
The string p is equal to the string q. The object p is not the object q. Robert _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor