简体   繁体   English

在python中打印多个空行

[英]Printing multiple blank lines in python

Is there a way that you can print more than one blank line in a programme, without having to type有没有一种方法可以在程序中打印多个空行,而无需键入

print("\n")

load of times?负载时间?

For example, I want to have a blank page (about 40 lines, I think) before my next line of text例如,我想在下一行文本之前有一个空白页(我认为大约 40 行)

只需使用乘法,这将重复您的字符串,无论您想要多少次,在这种情况下都是新行

>>> print('\n' * 40)

You want to print one black line in program use simple code here some example :您想在程序中使用简单的代码打印一条黑线,这里有一些示例:

print('\\n') print("welcome to python")打印('\\n')打印(“欢迎使用python”)

output:输出:

welcome to python欢迎来到蟒蛇

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM