python初试-九九乘法表

int1 = 1
int2 = 1
while int1 <= 9:
int2 = 0
while int2< int1:
int2 = int2 + 1
strs = str(int1) + ' * ' + str(int2) + ' = ' + str(int1 * int2)
len1=len(strs)
if len1==9:
print(strs + ' ',end='')
else:
print(strs + ' ', end='')
print('')
int1=int1+1

 

posted @ 2020-07-29 16:01  海月孤影  阅读(117)  评论(0编辑  收藏  举报