str().join() isn't working

Steve Holden steve at holdenweb.com
Tue Aug 21 12:54:56 EDT 2007


kyosohma at gmail.com wrote:
> On Aug 20, 1:16 pm, "Robert Dailey" <rcdai... at gmail.com> wrote:
[...]
> When you use join, you join the items in the list with each other to
> form one long string. In your statement, your script tries to
> concatenate 2 lists to each other before it does the join, which is
> impossible in Python. The "+" operator is only for addition and for
> two or more strings.
> 
Bzzzt!

 >>> ["you", "can't", "add", "lists?"] + ["-", "nonsense!"]
['you', "can't", 'add', 'lists?', '-', 'nonsense!']
 >>>

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------




More information about the Python-list mailing list