Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:two': 0.04; 'ascii': 0.07; 'am,': 0.12; 'character:': 0.16; 'dave.': 0.16; 'from:addr:dave': 0.16; 'received:173.11': 0.16; 'wrote:': 0.16; '>>>': 0.18; 'example.': 0.18; 'header:In-Reply-To:1': 0.22; 'received:192.168.1.100': 0.23; 'print': 0.29; 'separately': 0.30; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'but': 0.37; 'received:192': 0.38; 'why': 0.39; 'received:192.168.1': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'your': 0.61; 'received:173': 0.64; 'subject:add': 0.67; 'printable': 0.84 Date: Mon, 30 Jan 2012 22:25:43 -0600 From: David Lambert User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16 MIME-Version: 1.0 To: python-list@python.org Subject: Re: add two strings References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1327983955 news.xs4all.nl 6925 [2001:888:2000:d::a6]:42918 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19623 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.