Python 图案打印--九九乘法表

i = 1
while i <= 9:
	j = 1
	while j <= i:
		result = i * j
		if result < 10:
			print("%s X %s = %s  "%(j,i,result),end="")
		else:
			print("%s X %s = %s "%(j,i,result),end="")
		j += 1
	print("")
	i += 1

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/XY0918ZWQ/article/details/111147817