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


Groups > comp.lang.python > #91626

Re: Where is 'palindrome' defined?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <omar.aboumrad@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'mentioned,': 0.07; "subject:' ": 0.07; 'nameerror:': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.14; '&gt;&gt;&gt;': 0.15; 'invoking': 0.16; 'received:mail-la0-x229.google.com': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'email addr:gmail.com&gt;': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; '"",': 0.22; 'cc:no real name:2**0': 0.23; 'am,': 0.23; 'defined': 0.23; '2015': 0.23; 'header:In- Reply-To:1': 0.24; '(most': 0.24; 'mon,': 0.24; 'message- id:@mail.gmail.com': 0.28; 'online:': 0.29; 'function': 0.30; "skip:' 10": 0.30; 'skip:& 30': 0.31; 'traceback': 0.33; 'subject:?': 0.34; 'skip:& 20': 0.34; 'skip:& 10': 0.34; 'file': 0.34; 'received:google.com': 0.34; 'but': 0.36; 'hi,': 0.37; 'subject:: ': 0.37; 'thought': 0.37; 'further': 0.60; 'your': 0.60; "you've": 0.61; 'reverse': 0.66; 'subject:Where': 0.84; 'careful': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=l/t8MDw1chFIngfNqDIe+sAEcCBsfriVESAVsNuCGQQ=; b=RGRiCbbdDMpVBmKuApRKCHjpzzexZxbT+EABPOrfoQPcLTmxc4Af3kuGDwzAXZBntH jYYTbfjIwinRk+77N3CSG6TkWmPcZSLyFk/BLXoNJTPD0P/9sN9tnBQfz2DhfJ1rXXtP iftIZZCAxrMEtNZWX/FGyvKEGHmbsBmxx6JptI7ky0SPlVqSTJtH7xjrz/LB0YR5qpNO Yn25yeL1Bt7IZL0ax76RsBSAX9A4m/KnNhSzwI/fi2O2XK7VGGebG6CVNfx260gAJwI3 aDexphzLSYBkZAWkKzEf+mbn+ezW11uC7cwzUI6SRWWXwBKdTG4LcDeGM8ZkUc3Ev00P kSwg==
MIME-Version 1.0
X-Received by 10.152.7.7 with SMTP id f7mr19870430laa.106.1433142033704; Mon, 01 Jun 2015 00:00:33 -0700 (PDT)
In-Reply-To <83a279a3-133d-4a50-9af3-054233bcc6af@googlegroups.com>
References <83a279a3-133d-4a50-9af3-054233bcc6af@googlegroups.com>
Date Mon, 1 Jun 2015 10:00:33 +0300
Subject Re: Where is 'palindrome' defined?
From Omar Abou Mrad <omar.aboumrad@gmail.com>
To fl <rxjwg98@gmail.com>
Cc python-list@python.org
Content-Type multipart/alternative; boundary=001a11c2870ad4efa205176f61b8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.268.1433142041.5151.python-list@python.org> (permalink)
Lines 69
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1433142041 news.xs4all.nl 2844 [2001:888:2000:d::a6]:54210
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91626

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Jun 1, 2015 at 7:46 AM, fl <rxjwg98@gmail.com> wrote:

> Hi,
>
> When I search solution of reverse a string/number, I came across a short
> function online:
>
> >>> def palindrome(num):
>         return str(num) == str(num)[::-1]
>
> I thought that it is a general function. And with the following variable:
>
> >>> a
> '1234_5555'
>
> >>> parlindrome(a)
>
> Traceback (most recent call last):
>   File "<pyshell#126>", line 1, in <module>
>     parlindrome(a)
> NameError: name 'parlindrome' is not defined
>
> <snip>


Further to the mentioned, be careful with your spelling, the function name
as you've shown is "palindrome" but you're invoking it using "parlindrome".

Regards

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


Thread

Where is 'palindrome' defined? fl <rxjwg98@gmail.com> - 2015-05-31 21:46 -0700
  Re: Where is 'palindrome' defined? Gary Herron <gherron@digipen.edu> - 2015-05-31 23:55 -0700
    Re: Where is 'palindrome' defined? Grant Edwards <invalid@invalid.invalid> - 2015-06-01 15:02 +0000
  Re: Where is 'palindrome' defined? Larry Hudson <orgnut@yahoo.com> - 2015-05-31 23:56 -0700
  Re: Where is 'palindrome' defined? David Palao <dpalao.python@gmail.com> - 2015-06-01 08:58 +0200
    Re: Where is 'palindrome' defined? Marko Rauhamaa <marko@pacujo.net> - 2015-06-01 12:21 +0300
      Re: Where is 'palindrome' defined? David Palao <dpalao.python@gmail.com> - 2015-06-01 11:41 +0200
      Re: Where is 'palindrome' defined? John Ladasky <john_ladasky@sbcglobal.net> - 2015-06-02 14:14 -0700
        Re: Where is 'palindrome' defined? Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 01:30 +0300
  Re: Where is 'palindrome' defined? Omar Abou Mrad <omar.aboumrad@gmail.com> - 2015-06-01 10:00 +0300
  Re: Where is 'palindrome' defined? Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-01 15:17 +0000
  Re: Where is 'palindrome' defined? fl <rxjwg98@gmail.com> - 2015-06-01 17:55 -0700
    Re: Where is 'palindrome' defined? sohcahtoa82@gmail.com - 2015-06-01 18:07 -0700
    Re: Where is 'palindrome' defined? MRAB <python@mrabarnett.plus.com> - 2015-06-02 02:10 +0100

csiph-web