Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'subject:based': 0.07; 'python': 0.08; 'from:addr:python': 0.09; 'it;': 0.09; 'debugging': 0.13; 'wrote:': 0.15; "2's": 0.16; 'eval': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'idle,': 0.16; 'linefeed': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reply- to:addr:python-list': 0.16; 'reversed': 0.16; 'undesirable.': 0.16; 'windows?': 0.16; '(perhaps': 0.19; 'string,': 0.19; 'input': 0.21; 'header:In-Reply-To:1': 0.22; 'way?': 0.23; 'code': 0.24; 'writes:': 0.25; 'string': 0.26; 'windows': 0.26; 'character': 0.28; 'received:84': 0.28; 'correct': 0.29; 'problem': 0.29; 'yields': 0.30; 'print': 0.32; 'does': 0.32; 'usually': 0.33; 'to:addr:python-list': 0.34; 'header:User- Agent:1': 0.34; 'reply-to:addr:python.org': 0.35; 'uses': 0.35; 'towards': 0.35; 'but': 0.37; 'could': 0.37; 'subject:: ': 0.38; 'run': 0.39; 'should': 0.39; 'under': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'results': 0.62; 'john': 0.62; 'header:Reply- To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'case?': 0.84; 'hanging': 0.84; 'subject:different': 0.84 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0HAJYBFk7Unw4S/2dsb2JhbABTmEKOdHeIfcJOhjgEl0OEVIZx Date: Thu, 07 Jul 2011 19:59:05 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: i get different answers based on run platform References: <842fce9d-1b3f-434a-b748-a6dc4828c385@h12g2000pro.googlegroups.com> 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 Reply-To: python-list@python.org 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310065208 news.xs4all.nl 21882 [2001:888:2000:d::a6]:48787 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9054 On 07/07/2011 19:37, John Gordon wrote: > In<842fce9d-1b3f-434a-b748-a6dc4828c385@h12g2000pro.googlegroups.com> linda writes: > >> I have this simple palindrome program that yields different results >> depending on whether I run it from Windows or from IDLE. The answer >> is correct off IDLE, but why is this the case? Here's the code: > > Your code contains debugging statements that print the value of the normal > string and the reversed string. What do those statements print when you > run your program under Windows? That should go a long way towards telling > you what the problem is. > > (Perhaps Windows leaves a linefeed character hanging at the end of the > input line, which upsets the palindromic balance?) > > By the way, I could not make your program work as you provided it; I had > to replace input() with raw_input(). Does it really work for you this way? > It's Python 3. Python 2's raw_input() has been renamed input() in Python 3 and Python 2's input() was never in Python 3 because it uses eval on the string, which usually undesirable.