headfirst python。实验的时候 print("t",end='')打印制表符不换行, 出错。
print在python3.0中与python 2.x中是不同的
在python 2.7中打印输出不换行可以这样写 :
i = 10
while i > 0:
print i,
i = i-1
10 9 8 7 6 5 4 3 2 1

如果去掉print(“t")后面的逗号实现效果如下:

最后
以上就是欣喜小松鼠最近收集整理的关于python2.7与python3中print的一点不同之处的全部内容,更多相关python2.7与python3中print内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复