一、输出到显示器

1.可以输出数字 

print(1)

2.可以输出字符串,但要''、“”

        

print("hello")
        print('hello')

3.可以输出带运算符的表达式

print(6+1)

二、输出到文件里面

f = open("D:/demo1.txt",'a+')
print(‘hello python’,file=f)
f.close()

注意:1.print()函数里面的flie一定要等于前面定义的变量

2.open()里面的a+、r、w是表示累加、读文件、写文件的意思