关于print()里面的sep和end参数的使用

print('hello', 'world')   #默认用空格隔开
#hello world

print('hello', 'world', sep='wuli') #sep=''可以用来设置连接的字符串
#hellowuliworld

print('hello')
print('world')  #print有默认换行功能
#hello
#world

print('hello', end='')  #end=''可以设置print结束后的字符
print('world')
#hello哈world

猜你喜欢

转载自www.cnblogs.com/SakuraYuanYuan/p/10232064.html