Home >Backend Development >Python Tutorial >How to start a new line in python?

How to start a new line in python?

烟雨青岚
烟雨青岚Original
2020-07-08 15:46:2510277browse

There are three methods, namely: 1. Enter three single quotation marks (''') where a new line needs to be started; 2. Enter three double quotation marks ("" where a new line needs to be started) "); 3. Enter a backslash (\) where you need to start a new line.

How to start a new line in python?

Three ways to wrap a string in Python:

#The first type: three single quotes

print ''' I am a programmer

I just started learning python'''

#Second type: three double quotes

print """ I am a programmer

I just started learning python"""

#Third Type:\End

print "I am a programmer,\

I just started learning python"

Recommended tutorial: "python 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