python> print> N line breaks> print ('\ n'* 3)> 4 line breaks> print ('\ n'* 3),> 3 line breaks

Python Programming https://www.youtube.com/watch?v=N4mEzFDjqtA&index=34&list=WL Around 08:00

You're probably saying, "Insert a five-line line break."

print('\n' * 5)

http://ideone.com/6JiHrn When implemented in

test.py


print "start"
print('\n' * 3)
print "end"

result


Success	time: 0.02 memory: 44632 signal:0
start




end

I feel that there are many line breaks on one line.


I did the above on CentOS 6.5, but again there were 4 line breaks.

In other words

print('\n' * 3)

In that case, in addition to the three line breaks, the line breaks of the print itself will be inserted.

If you add a comma at the end as print ('\ n'* 3),, you will get only 3 line breaks, but I don't know if the code is easy to read.

http://ideone.com/F0Ky6U

Link http://qiita.com/7of9/items/ac371b545213d2862bc8

Recommended Posts

python> print> N line breaks> print ('\ n'* 3)> 4 line breaks> print ('\ n'* 3),> 3 line breaks
Print with python3 without line breaks
[Introduction] Insert line breaks in Python 3
LINE heroku python
Python print function (sequel)
python2 series / 3 series, character code and print statement / command line
Display character strings without line breaks in python (personal memo)
Fizzbuzz in Python (in one line)
[Line / Python] Beacon implementation memo
Try LINE Notify in Python
Broadcast on LINE using python
python> Get substring> print serial [5:10] / print serial [5: -1]
Command line argument processing (Python docopt)
Make python segfault in one line
[Python] Make your own LINE bot
Try the Python LINE Pay SDK
[Python] Be careful when using print
Windows and Unix line breaks Split
cout << "Hello, World! \ N" in python
I tried Line notification in Python
Implemented in 1 minute! LINE Notify in Python
Read the file with python and delete the line breaks [Notes on reading the file]