Re: Concantenation and string slicing



Dennis Lee Bieber wrote:
On Thu, 23 Feb 2006 18:06:46 -0600, Larry Bates
<larry.bates@xxxxxxxxxxx> declaimed the following in comp.lang.python:


Better was is:

message = raw_input("Enter a message: ")
print message[::-1]


I sometimes get the feeling a lot of responses to newbies, lately,
fail to explain what was wrong in the original code in favor of showing
off the tricks that Python is capable of...

Several others had already pointed out what was wrong (which
of course the OP would have know if he had done a tutorial).
I merely wanted to post a solution that IMHO was a much
better way to accomplish the task. The OP is free to choose
among the posted solutions. If others had not yet posted the
solution, I would have posted both.

-Larry Bates
.



Relevant Pages

  • Re: how to convert a dotted-decimal IP address into host internal IP address
    ... But I think the functions like RtlIPv* don't work. ... >I love responses like this. ... >you just have a bad feeling that they were flawed in some way? ... Or have you actually tried one and had it fail? ...
    (microsoft.public.development.device.drivers)
  • Re: To Joseph M. Newcomer
    ... > I have been reading your responses to the posts for a long time now. ... I am not an MVP but elsewhere I have helped fellow programmers ... Quoting error messages IN FULL in with error codes etc. Copy-and-Paste ... - does it fail to compile? ...
    (microsoft.public.vc.mfc)
  • Re: allowing only packets from a certain ip address
    ... > that you have already received some good responses for your most pressing ... > you up that steep learning curve, ... I mean is'nt this group aboiut heping those in need. ... THat is not a very nice feeling. ...
    (comp.os.linux.security)
  • Re: speaker check up check list?
    ... apa wrote: ... > Thanks for all the responses. ... > Is there anything that would cause a speaker to fail such that it ... > sounds alright at lower volumes but no longer cleanly handles the ...
    (rec.audio.pro)
  • Re: Cool visual illusion
    ... >>> societal significance of the feeling. ... >> arrange contingencies that make our own behavior discriminative stimuli. ... we can feel pleasure and pain in the absence of societal ... or when other responses are under ...
    (comp.ai.philosophy)