a=input('Standard game? (y/n): ')
if a=='y':
print('''5 · · · · · · ·
4 · · · · · · ·
3 · · · · · · ·
2 · · · · · · ·
1 · · · · · · ·
0 · · · · · · ·
0 1 2 3 4 5 6 ''')
else:
r=int(input('r? (2 - 20): '))
c=int(input('c? (2 - 20): '))
for i in range(r-1,-1,-1):
print(str(i)+' .'*c)
for j in range(c):
print(' '+str(j),end='')
你题目的解答代码如下:(如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮)
a=input('Standard game? (y/n): ')
if a=='y':
r = 6
c = 7
else:
r=int(input('r? (2 - 20): '))
c=int(input('c? (2 - 20): '))
rl = 1 if r-1<10 else 2
cl = 2 if c-1<10 else 3
for i in range(r-1,-1,-1):
print(('{:>'+str(rl)+'}').format(i),end="")
print(('{:>'+str(cl)+'}').format(".")*c)
print(' '*rl,end="")
for j in range(c):
print(('{:>'+str(cl)+'}').format(j),end="")