Re: [Tutor] Question about string

2008-07-03 Thread Michael yaV
tion (concatenation) is done which is a much more expensive operation in terms of computer power. The first is only possible if you have literal strings but the second can be used for variables: s1 = 'a' s2 = 'b' s = s1 s2 # doesn't work s = s1 + s2 # works HTH,

Re: [Tutor] Question about string

2008-07-03 Thread Dong Li
> Date: Thu, 3 Jul 2008 10:18:23 +0100 > From: "Alan Gauld" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Question about string > To: tutor@python.org > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; format=flowed; charset="iso-8859-1&q

Re: [Tutor] Question about string

2008-07-03 Thread Monika Jisswel
Python is one of the smartest languages, it does many things for the programmer (I don't know but this might be what they mean with Batteries-Included) , & you have just scratched the surface of it, here python concatenated your strings together for you, later you will meet list comprehention & o

Re: [Tutor] Question about string

2008-07-03 Thread Alan Gauld
"Dong Li" <[EMAIL PROTECTED]> wrote I am new to python, so what I ask may be so basic. I don't know the difference between s = 'a' 'b' and s = 'a'+'b' They have the same results. Thanks for relying! I think the differencec is that the first is purely a syntax thing so the interpreter does t

[Tutor] Question about string

2008-07-02 Thread Dong Li
Hi, everyone I am new to python, so what I ask may be so basic. I don't know the difference between s = 'a' 'b' and s = 'a'+'b' They have the same results. Thanks for relying! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/li