Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Python string concatenation not working as expected
  2. out = 'Hello'
  3. print( out.join([' world']) )
  4.        
  5. world
  6.        
  7. ' '.join(['Hello', 'world'])
  8. >> Hello world
  9.  
  10. ','.join(['Hello', 'world'])
  11. >> Hello,world
  12.  
  13. '/'.join(['name', 'location', 'age'])
  14. >> name/location/age
  15.  
  16. '*'.join(['name'])
  17. >> name
  18.  
  19. 'hello'.join(['world'])
  20. >> world