记录学习Python的日常
左下:
代码:
for i in range(1, 10):
for j in range(1, i + 1):
print(' {0}*{1}={2}'.format(j, i, i * j).ljust(6), end=' ')
print()
截图:
?左上:
代码:
for i in range(1, 10):
for j in range(1, 11-i):
print(' {0}*{1}={2}'.format(j, i, i * j).ljust(8), end=' ')
print()
截图:
右上:
代码:
for i in range(1, 10):
for k in range(1, i):
print(end=" ")
for j in range(i,10):
print('{0}*{1}={2}'.format(j, i, i * j).ljust(6), end=' ')
print()
截图:
?
?右下:
代码:
for i in range(1, 10):
for k in range(1, 10-i):
print(end=" ")
for j in range(1,i+1):
print('{0}*{1}={2}'.format(j, i, i * j).ljust(6), end=' ')
print()
截图:
?
|