2019-07-04
阅读量:
661
python以什么参数结束函数
默认情况下,python的print()函数以换行符结束。具有C / C ++背景的程序员可能想知道如何在没有换行的情况下进行打印。
Python的print()函数带有一个名为'end'的参数。默认情况下,此参数的值为'\ n',即新行字符。您可以使用此参数结束包含任何字符/字符串的print语句。
# This Python program must be run with
# Python 3 as it won't work with 2.7.
# ends the output with a <space>
print("Welcome to" , end = ' ')
print("GeeksforGeeks", end = ' ')






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论