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

Steven Bethard steven.bethard at gmail.com
Thu May 26 16:22:04 EDT 2005


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



More information about the Python-list mailing list