Re: "...Learning with Python" ...a property that addition andmultiplication have...

2005-05-26 Thread Steven Bethard
GMane Python wrote: > string repetition can not repeat a value negative times: > 'hello' * -3 is invalid. Well, it's not invalid: py> 'a' * -1 '' py> 'a' * -42 '' but you could definitely say that S * N1 == S * N2 does not imply that N1 == N2 STeVe -- http://mail.python.org/mailman/l

Re: "...Learning with Python" ...a property that addition andmultiplication have...

2005-05-26 Thread GMane Python
The inablility to work with negative values. Addition can do the following: 5 + (-4) read as 5 plus the value negative four. Multiplication can do the following: 5 * (-1) read as 5 times the value negative one. String concatination can not subtract the sub-string 'lo' from 'hello'. 'hello' - 'l

Re: "...Learning with Python" ...a property that addition andmultiplication have...

2005-05-25 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Greetings. > > I'm reading "How to think like a computer scientist: Learning with > Python" and there's a question regarding string operations. The > question is, "Can you think of a property that addition and > multiplication have tha