原版的:
for row in range(1,10):
for col in range(1,10):
prod = row * col
if prod < 10 :
print(" ",end= " ")
print(row*col," ",end= " ")
print()
方便查看步骤的
for row in range(1,10):
for col in range(1,10):
prod = row * col
if prod < 10 :
print("a",end= "b")
print(row*col,"c",end= "d")
print("s")
注意:print()语句中,““,””打印出来的时候会出现空格。即print("a","b")打印出来的时候是:a b 这样的形式
print 默认输出是换行的,如果要实现不换行需要在变量末尾加上逗号 ,或者end=