#将内容输出到显示台
#1.print函数可以输出数字
print(520)
print(98.5)
#2.print函数可以输出字符串
print('helloworld')
print("helloworld")
#注意输出字符串时单双引号都可以
#3.print函数可以输出含有运算符的表达式
print(3+1)
print(4-2)
#数字叫做操作数,+、-叫做运算符
#将内容输出到文件中
fp=open('D:/text.txt','a+')
#a+表示如果文件不存在就创建文件,如果存在就在文件内容的后面继续追加
print('helloworld',file=fp)
fp.close()
#注意:1.所指定的盘符存在 2.使用file=fp
#不换行的输出(输出内容要在一行中)
print('hello','world','python')
运行结果: