Home  >  Article  >  Backend Development  >  How to start a new line in python

How to start a new line in python

coldplay.xixi
coldplay.xixiOriginal
2020-08-11 13:48:0511868browse

How to start a new line in python: 1. Use three single quotes to wrap the line; 2. Use three double quotes to wrap the line; 3. Use the end of [\] to wrap the line.

How to start a new line in python

How to start a new line in python:

First method: three single quotes

print ''' 我是一个程序员
我刚开始学习python'''

The second type: three double quotes

print """ 我是一个程序员
我刚开始学习python"""

The third type: ending with \

print "我是一个程序员,\
我刚开始学python"

Related learning recommendations: python video tutorial

The above is the detailed content of How to start a new line in python. For more information, please follow other related articles on the 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