基本概念:
end='结尾符',不加end则默认换行
print(520)
print('helloworld',end='n')
print(3+1)
#将数据输出文件中,注意点:1.所指定盘存在,2.使用file=fp
fp=open('D:/text.txt','a+')#a+含义如果文件不存在就创建,若存在怎在文件内容后继续加
print('helloworld',file=fp)
fp.close()
print('hello','world','python')#不进行换行输出
代码运行结果:
E:vippythonvenvScriptspython.exe E:/vippython/demo1(print).py 520 helloworld 4 hello world python Process finished with exit code 0



