python 99乘法表
先把代码贴上
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
for i in range(1,10): for j in range(1,i+1): s="%d X %d = %d"%(j,i,i*j) print(s,end=" ") print("")
输出不换行怎么搞 end=""
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
for i in range(10): print(str(i)*5,end="") """ for i in range(10): print(str(i)*5,end="") 00000111112222233333444445555566666777778888899999 """")
光标跳到开头\r
缩进是\t
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
for i in range(10): print("\r",str(i)*5) for i in range(10): print("\t",str(i)*5) """ 00000 11111 22222 33333 44444 55555 66666 77777 88888 99999 00000 11111 22222 33333 44444 55555 66666 77777 88888 99999 """
给你们说一下 end和\r在一起可以实现奇效 时钟和进度条都是这样玩的。 效果就是及时刷新
-----------------------------------------------------------------------------------------------------------------------------------------