Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list to string
#1
"""
Create a function called list2str, that takes two arguments - a list of
strings L, and a delimeter D. The function must:
  1. Return a single string, containing all of the input strings joined together
  with D as a delimeter between them. The result should not start or end with
  the delimeter D - D should be used only between the substrings.
  2. When inspected, would return the following help string:
    Join the list L using the delimeter D


For example:
  list2str( ['a','b','c'], ',') -> 'a,b,c'
  list2str('We','are','the','location','cloud','.') -> 'We are the location cloud.'
"""
Reply


Messages In This Thread
list to string - by roadrage - Nov-28-2016, 09:24 PM
RE: list to string - by Yoriz - Nov-28-2016, 09:33 PM
RE: list to string - by nilamo - Nov-28-2016, 09:52 PM
RE: list to string - by roadrage - Nov-29-2016, 05:31 PM
RE: list to string - by micseydel - Nov-29-2016, 05:56 PM
RE: list to string - by nilamo - Nov-29-2016, 10:14 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020