9乘以9乘法口诀for和while循环

实现乘法口诀for循环
# for i in range(1,10): # for j in range(1,i+1): #第二层循环写上1到i+1这样就可以实现 1*1 2*1 2*2 等 # print('%s * %s = %s'%(i,j,i*j),end=" ") # #格式化输出乘法口诀 # print('') #

实现乘法口诀 while循环 # count
= 1 #定义两个初始值 # s=1 # while count <=9: # while s <=9: # print('%s * %s = %s'%(count,s,count*s),end=' ') # if s == count: #判断s = count的时候 跳出循环 # s=1 # break # s+=1 # # print(' ') # count+=1

 

posted @ 2018-01-31 20:03  运维面试辅导  阅读(186)  评论(0)    收藏  举报