默认情况下,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 = ' ')
另一个演示结束参数工作的程序。
# This Python program must be run with
# Python 3 as it won't work with 2.7.
# ends the output with '@'
print("Python" , end = '@')
print("GeeksforGeeks")
三个资料Q群下载不了也转发不了,先放这里Fine_tuning.zipLangChain.zipdata_clear.rar