打印九九乘法表

2023-01-31 00:01:30 打印 九九 乘法表
 1 line =9
 2 while line >0:
 3     #print ("*")
 4     tmp =line
 5     while tmp >0:
 6         print ("#",end="")
 7         tmp-=1
 8     line -=1
 9     print()
10     
11 first  =0
12 while first <=9:
13     sec =1
14     while sec <= first:
15         print (str(sec) + "*" + str(first) + "=" +str(sec * first) , end ="\t")
16         sec +=1
17     first +=1
18     print ()
View Code

 

相关文章