Re: Concantenation and string slicing
- From: Larry Bates <larry.bates@xxxxxxxxxxx>
- Date: Sat, 25 Feb 2006 15:32:28 -0600
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
.
- References:
- Concantenation and string slicing
- From: DannyB
- Re: Concantenation and string slicing
- From: Larry Bates
- Concantenation and string slicing
- Prev by Date: Re: Optimize flag question
- Next by Date: Re: spaces at ends of filenames or directory names on Win32
- Previous by thread: Re: Concantenation and string slicing
- Next by thread: remote module importing (urlimport)
- Index(es):
Relevant Pages
|