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


Groups > comp.lang.python > #9050

Re: i get different answers based on run platform

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: i get different answers based on run platform
Date 2011-07-07 18:37 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <iv4ue2$ij0$1@reader1.panix.com> (permalink)
References <842fce9d-1b3f-434a-b748-a6dc4828c385@h12g2000pro.googlegroups.com>

Show all headers | View raw


In <842fce9d-1b3f-434a-b748-a6dc4828c385@h12g2000pro.googlegroups.com> linda <postslot@gmail.com> 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?

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

i get different answers based on run platform linda <postslot@gmail.com> - 2011-07-07 11:18 -0700
  Re: i get different answers based on run platform John Gordon <gordon@panix.com> - 2011-07-07 18:37 +0000
    Re: i get different answers based on run platform Ethan Furman <ethan@stoneleaf.us> - 2011-07-07 12:11 -0700
    Re: i get different answers based on run platform MRAB <python@mrabarnett.plus.com> - 2011-07-07 19:59 +0100
      Re: i get different answers based on run platform linda <postslot@gmail.com> - 2011-07-07 14:09 -0700
        Re: i get different answers based on run platform Ethan Furman <ethan@stoneleaf.us> - 2011-07-07 14:42 -0700
          Re: i get different answers based on run platform linda <postslot@gmail.com> - 2011-07-07 14:37 -0700
  Re: i get different answers based on run platform Ethan Furman <ethan@stoneleaf.us> - 2011-07-07 11:58 -0700
  Re: i get different answers based on run platform MRAB <python@mrabarnett.plus.com> - 2011-07-07 19:54 +0100

csiph-web