-
Anonymous
Объединение списков Python — включите разделитель в начале или в конце
Сообщение
Anonymous »
Вывод для ', '.join(['a', 'b', 'c', 'd']):
a, b, c, d
Есть ли в Python стандартный способ достижения следующих результатов?
# option 1, separator is also at the start
, a, b, c, d
# option 2, separator is also at the end
a, b, c, d,
# option 3, separator is both at the start and the end
, a, b, c, d,
Подробнее здесь:
https://stackoverflow.com/questions/549 ... at-the-end
1733525034
Anonymous
Вывод для ', '.join(['a', 'b', 'c', 'd']):
a, b, c, d
Есть ли в Python стандартный способ достижения следующих результатов?
# option 1, separator is also at the start
, a, b, c, d
# option 2, separator is also at the end
a, b, c, d,
# option 3, separator is both at the start and the end
, a, b, c, d,
Подробнее здесь: [url]https://stackoverflow.com/questions/54989167/python-list-joining-include-separator-at-the-start-or-at-the-end[/url]