for row in range(1,10): for col in range(1,row+1): print(row * col,end=" ") print("")
#函数版本def printLine(row): for col in range(1,row+1): print(row * col,end=" ") print("") for row in range(1,10): printLine(row)