當前位置:編程學習大全網 - 網站源碼 - python打印99乘法表怎麽對齊

python打印99乘法表怎麽對齊

1、實現源碼

def buildMulTable():

for x in range(1, 10):

for y in range(1, x + 1):

print('{}x{}={}\t'.format(y, x, x * y), end='')

print(end='\n')

buildMulTable()

2、實現說明

(1)使用了 \t 空格符

(2)使用了 \n 換行符

3、實現結果

  • 上一篇:國外哪個機房的空間比較好?
  • 下一篇:如何用selenium驅動chrome瀏覽器,並在手機模式下打開?
  • copyright 2024編程學習大全網