How to wrap python print

little bottle
Release: 2019-05-30 16:29:28
Original
17210 people have browsed it

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"
Copy after login

ab

c

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

print "ab\r\nc"
Copy after login

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!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template