semi-concatenated strings

Tim Roberts timr at probo.com
Sat Jun 1 07:23:49 CEST 2002


Grant Griffin <Grant_member at newsguy.com> wrote:
>
>I discovered today that strings can sometimes be concatenated without using a
>"+":
>
>   ActivePython 2.2.1 Build 222 (ActiveState Corp.) based on
>   Python 2.2.1 (#34, Apr 15 2002, 09:51:39) [MSC 32 bit (Intel)] on win32
>   Type "help", "copyright", "credits" or "license" for more information.
>   >>> a = 'one' ' plus ' 'two'
>   >>> a
>   'one plus two'

It is interesting (but only marginally relevant) to note that this exact
same feature is part of ISO standard C:

  #include <stdio.h>
  int main()
  {
      puts( "one" " plus " "two" );
  }
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list