打印1-9三角形阵列:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
for i in range(1,11):
for k in range(1,i):
print k,
print"\n"
输出结果:
1
12
123
1234
12345
123456
1234567
12345678
123456789
打印1-9三角形阵列:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
for i in range(1,11):
for k in range(1,i):
print k,
print"\n"
输出结果:
1
12
123
1234
12345
123456
1234567
12345678
123456789