Get the App
SLTechnology News&Howtos  ›  Development  › 

How python concatenates strings in iterable objects

Shulou Source: shulou.com Published: 2022-06-01 05:26:45 10月11日 Update

This article mainly introduces how python connects strings in iterable objects. It is very detailed and has some reference value. If you are interested, you must read it.

Concatenate strings in iterable objects

When working with strings, it is sometimes necessary to create a single string by concatenating a series of strings within iterable objects such as lists, tuples, and so on. In this case, the join () function can be called with the desired delimiter.

> words = ('Hello','Python',' Programmers') >'!!. Join (words) 'Hellogged Pythony programmers' > > words_dict = {0: 'zero', 1:' one', 2: 'two', 3:' three'} > & '.join (words_dict.values ())' zero&one&two&three' is all the contents of the article "how to join strings in iterable objects". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Characters strings objects iterations content articles values interests functions delimiters individual buddy situation more knowledge industry information information channels channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Apple Shulou Technology OPPO Reno