print函数
#输出字符串
print('hellozhourui')
print("hello")
执行结果:
hellozhourui
hello
#输出数字
print(99.3)
执行结果:
99.3
#输出含有运算符的表达式
print(3+2)
执行结果:
5
#将数据输出到文件中
fp=open('C:/project/pythonstudy/print.txt','a+')
print('helloworld',file=fp)
fp.close()
执行结果:
#不进行换行输出
print('hello','world','python')
执行结果:
hello world python