Posted By

magicrebirth on 02/18/10


Tagged

python join


Versions (?)

joning lists


 / Published in: Python
 

URL: http://www.faqs.org/docs/diveintopython/odbchelper_join.html

join only works on lists of strings; it does not do any type coercion. joining a list that has one or more non-string elements will raise an exception.

  1. return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
  2.  
  3. # or
  4.  
  5. x = range(100)
  6.  
  7. print ";".join(["%s"%(f) for f in x])

Report this snippet  

You need to login to post a comment.