print底层代码(ctrl可查看)
def print(self, *args, sep=' ', end='\n', file=None): # known special case of print
sep代表:中间间隔符
- 改变连接方式
print(1314)#直接输出整数
print(3.14)#直接输出浮点数(带小数点的数)
print(1,2,3,4)#使用都行连接要输出的数字,中间用空格隔开
print(192,168,1,1,sep='.')#使用间隔符,进行连接,数值之间用“.”进行分隔
#print('北京欢迎你'+2022)#TypeError: can only concatenate str (not "int") to str
print("北京欢迎你"+"2022")
- 效果图