Home  >  Article  >  Backend Development  >  How to wrap python print

How to wrap python print

little bottle
little bottleOriginal
2019-05-30 16:29:2817198browse

Each language has its own different language style, and the same is true for python. So during the learning process, be careful not to confuse its operations with other languages. Next, I will tell you how to achieve output line break in python?

How to wrap python print

When simply printing output, if you want to get the line break effect:

print  "ab\nc"

ab

c

In file operations If you want to read the newline effect, you must write:

print "ab\r\nc"

ab

c

The above is the detailed content of How to wrap python print. 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