<div class="im">On 23 August 2012 15:17, Victoria Homsy <span dir="ltr">&lt;<a href="mailto:victoriahomsy@yahoo.com" target="_blank">victoriahomsy@yahoo.com</a>&gt;</span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">

<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif"><div class="im"><div style="background-color:transparent">def isPalindrome(s):</div>

<div style="background-color:transparent"><span style="white-space:pre-wrap">        </span>if len(s) &lt;= 1: return True</div><div style="background-color:transparent"><span style="white-space:pre-wrap">        </span>else: return s(0) == s(-1) and isPalindrome (s[1:-1])</div>

<div style="background-color:transparent"><span style="white-space:pre-wrap">        </span></div></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">

<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif"><br></div><div class="im"><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">

I don&#39;t see why this wouldn&#39;t work...</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">

Many thanks in advance. </div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">

Kind regards,</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif">

Victoria <br></div></div></div></div></div></div></blockquote><br>Parentheses
 are used for function arguments in Python, whereas square brackets are 
used for slices - so the first character of s is not s(0) but s[0].<br><br>
When you say s(0) and s(-1), Python thinks you&#39;re calling s as a 
function with 0 or -1 as the argument - hence, &quot;str object is not 
callable&quot;.