On 2/4/2012 11:53 AM, Steven D'Aprano wrote:
[snip]
In the interactive interpreter, as a convenience, the result of each
line is automatically printed for you:
Actually the interpreter prints the result of each /statement /that IS
an /expression/.
>>> 2
2
>>> a = 3
>>> a
3
IOW if the line i
On Sat, Feb 4, 2012 at 11:42 AM, Sivaram Neelakantan
wrote:
> On Sat, Feb 04 2012,bob gailer wrote:
>
>> On 2/4/2012 9:38 AM, Sivaram Neelakantan wrote:
>>> While trying out code, I have trouble following the difference between
>>>
>>> return True vs print True and the same with False. If I use r
Sivaram Neelakantan wrote:
def palin(text):
if first(text) == last(text):
# print first(text), last(text), middle(text), len(middle(text))
if len(middle(text)) == 0:
print True
else:
palin(middle(text))
else:
print False
Every br
Sivaram Neelakantan wrote:
While trying out code, I have trouble following the difference between
return True vs print True and the same with False. If I use return
for the True/False statements, nothing gets printed. Why?
Probably because you aren't printing anything. Python can't read your
On Sat, Feb 04 2012,bob gailer wrote:
> On 2/4/2012 9:38 AM, Sivaram Neelakantan wrote:
>> While trying out code, I have trouble following the difference between
>>
>> return True vs print True and the same with False. If I use return
>> for the True/False statements, nothing gets printed. Why?
On 2/4/2012 9:38 AM, Sivaram Neelakantan wrote:
While trying out code, I have trouble following the difference between
return True vs print True and the same with False. If I use return
for the True/False statements, nothing gets printed. Why?
Why did you expect something to be printed?
Per
While trying out code, I have trouble following the difference between
return True vs print True and the same with False. If I use return
for the True/False statements, nothing gets printed. Why? And if I
add a print before the function call I get an output like
>>>True
None
--8<---