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在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")后面的逗号实现效果如下: