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?
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!