import sys
for i in range(1,10):
for j in range(1,10):
if j<=i:
sys.stdout.write(str(i * j))
sys.stdout.write(“\t”)
if i==j:
print “”
结果:
1
2
4
3
6
9
4
8
12
16
5
10
15
20
25
6
12
18
24
30
36
7
14
21
28
35
42
49
8
16
24
32
40
48
56
64
9
18
27
36
45
54
63
72
81