Inheritance and Attributes

Lee Harr missive at frontiernet.net
Thu Feb 13 18:45:25 EST 2003


>          print "setting " + str(self) + ".cat = \"yellow\""


Maybe you are doing it this way for a reason, but if not, note
that you can do it like this in Python:

           print "setting " + str(self) + '.cat = "yellow"'


In other words, you can use either ' or " to delimit strings
and then the other one is fine inside of the string.





More information about the Python-list mailing list