How to output a list in python

藏色散人
Release: 2019-10-18 11:39:29
Original
12487 people have browsed it

How to output a list in python

How does python output a list?

Just use the print function directly. For example:

L=['apple','fruit']#定义一个列表
print(L)#输出一个列表
Copy after login

Recommended: "Python Tutorial"

The output result is [ 'apple','fruit'].

How to output a list in python

Extended information:

Print without an output item outputs a blank line. If the output item of the previous print statement ends with something like " ," or ";" means that the output is on the same line. The empty print statement after it is used to eliminate the effect of the previous print statement always outputting on the same line, so that the subsequent output is on the next line.

The above is the detailed content of How to output a list in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!