for x in range(1,10): for y in range(1,x+1): z=x*y print("{}*{}={}".format(x,y,z),end=' ') print()
觉得有用的话采纳一下哈