Q: "...Learning with Python" ...a property that addition and multiplication have...

Greg Ewing greg at cosc.canterbury.ac.nz
Wed May 25 21:39:40 EDT 2005


jeffbernstein at yahoo.com wrote:
> "Can you think of a property that addition and
> multiplication have that string concatenation and repetition do not?"

Existence of inverses?

E.g. the additive inverse of 3 is -3, but there are
no "concatenative inverses" of strings.

(BTW, I would consider this more about thinking like a
mathematician than a computer scientist!)

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list