# -*- coding: utf-8 -*-
# @Time : 2021/9/25 7:41
# @Author : 李新宇
# @FileName: first.py
# @Software: PyCharm
# print("hello,world")
#5.输出函数print,输出到控制台或者文件当中
#可以输出数字
print(53)
#可以输出字符串
print("hello,wolrd")
print('hello,world')
#含有运算符的表达式
print(3+1)
#将数据输出到文件当中,注意点1、所指定的盘符存在,2、使用file=fp
fp=open('C:/text.txt','a+') #a+:如果文件不存在就创建,存在就在文件内容的后面继续追加
print('hello,world',file=fp)
fp.close()
#不进行换行输出
print('hello','world','good')
输出函数print
最新推荐文章于 2021-12-26 12:01:12 发布