Home  >  Article  >  Backend Development  >  Python list method to merge connection strings

Python list method to merge connection strings

高洛峰
高洛峰Original
2017-01-13 16:35:001988browse

For example, the following list

binfo = ['lao','wang','python']

We know through the help method that it can be solved by using the join method of string.

Below we use spaces to connect 3 words:

content = " ".join(binfo)
print content

The result is: lao wang python

For more related articles on python list methods of merging connection strings, please pay attention to PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn