返回顶部

整除 和 取余运算的应用 :

6//4 = 1   6%4 =2  因此是第(1+1)行第(2+1)列

 

Python 占位格式符的使用:

1 for i in range(24):
2     for j in range(60):
3         # print("%02d:%02d" % (i,j)) #0 表示不够两位进行填充。2是宽度。 Python2写法!
4         print("{:02}:{:02}".format(i,j)) #Python3中 format写法
输出24小时!!!

 

 

 

 

 

 

 

 

 posted on 2019-11-12 23:27  zcb070812  阅读(92)  评论(0编辑  收藏  举报