Shero / 第一周作业 .gitee-modal { width: 500px !important; }

Explore and code with more than 5 million developers，Free private repositories ！：）
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
1_while.py 809 Bytes
Shero authored 2018-10-15 16:34 . Upload 1_while.py 1_for.py
#左下九九乘法表
x1=1
while x1<=9:
y1=1
while y1<=x1:
print('{}*{}={}\t'.format(y1,x1,y1*x1),end=(''))
y1+=1
x1+=1
print()
print('='*70)

#左上九九乘法表
x2=1
while x2<=9:
y2=1
while y2<=10-x2:
print('{}*{}={}\t'.format(y2,10-x2,y2*(10-x2)),end=(''))
y2+=1
x2+=1
print()
print('='*70)

#右下九九乘法表
x3=1
while x3<=9:
y3=1
k=1
while k<=9-x3:
print(end=('        '))
k+=1
while y3<=x3:
print('{}*{}={}\t'.format(x3+1-y3,x3,(x3+1-y3)*x3),end=(''))
y3+=1
x3+=1
print()
print('='*70)

#右上九九乘法表
x4=1
while x4<=9:
y4=1
k=1
while k<x4:
print(end=('        '))
k+=1
while y4<=10-x4:
print('{}*{}={}\t'.format(11-x4-y4,10-x4,(11-x4-y4)*(10-x4)),end=(''))
y4+=1
x4+=1
print()
print('='*70)