Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19623 > unrolled thread

Re: add two strings

Started byDavid Lambert <dave@lambsys.com>
First post2012-01-30 22:25 -0600
Last post2012-01-30 22:25 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: add two strings David Lambert <dave@lambsys.com> - 2012-01-30 22:25 -0600

#19623 — Re: add two strings

FromDavid Lambert <dave@lambsys.com>
Date2012-01-30 22:25 -0600
SubjectRe: add two strings
Message-ID<mailman.5229.1327983955.27778.python-list@python.org>
On 01/30/2012 07:02 AM, contro opinion wrote:
> >>> s1='\x45'
> >>> s2='\xe4'
> >>> s1+s2
> 'E\xe4'
> >>> print  s1+s2
> E
>
> why  s1+s2  not  =  '\x45\xe4'??
>
It is, but '\x45' is ASCII 'E', and '\xe4' is not a printable character:
 >>> print '\x45'
E
 >>> print  '\xe4'

 >>>
Try printing s1 and s2 separately in your example.

HTH,

Dave.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web