About 50 results
Open links in new tab
  1. python - What exactly does the .join () method do? - Stack Overflow

    I'm pretty new to Python and am completely confused by .join() which I have read is the preferred method for concatenating strings. I tried: strid = repr(595) print array.array('c', random.sample(

  2. Python 3 string.join() equivalent? - Stack Overflow

    Dec 29, 2011 · In most cases you want to use your pythonic '.'.join() approach, but there are legitimate, pythonic uses for str.join() (formerly string.join()) too. For example, you sometimes …

  3. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · For handling a few strings in separate variables, see How do I append one string to another in Python?. For the opposite process - creating a list from a string - see How do I …

  4. Join a list of strings in python and wrap each string in quotation ...

    Aug 17, 2012 · Join a list of strings in python and wrap each string in quotation marks Asked 13 years, 6 months ago Modified 1 month ago Viewed 157k times

  5. python - How can I convert each item in the list to string, for the ...

    59 The map function in python can be used. It takes two arguments. The first argument is the function which has to be used for each element of the list. The second argument is the iterable.

  6. python - Why is it string.join (list) instead of list.join (string ...

    The algorithm Python uses to create the final string with str.join actually has to pass over the iterable twice, so if you provide it a generator expression, it has to materialize it into a list first …

  7. Using .join() in Python - Stack Overflow

    Dec 7, 2012 · Here you are using two joins - the inner join joins every element up until the second to last element with a comma. That string is then joined to the last element (a[-1]) using the …

  8. How to join entries in a set into one string? - Stack Overflow

    Basically, I am trying to join together the entries in a set in order to output one string. I am trying to use syntax similar to the join function for lists. Here is my attempt: list = ["gathi-109","

  9. python - How does os.path.join () work? - Stack Overflow

    Dec 17, 2013 · 8 Your second join call is not os.path.join, it is str.join. What this one does is that it joins the argument (as an iterable, meaning it can be seen as f, i, s, h) with self as the …

  10. .join() function not working in Python - Stack Overflow

    I was wondering if someone could help me figure out why my few lines of code isn't working in Python. I am trying to create my own version of the Battleship game, but I can't seem to get …