永恒的蓝色梦想
发表于 2019-8-18 16:38:49
for i in range(1,10):
for j in range(1,i+1):print(f'{i}*{j}={i*j}',end=' ')
print()
克里斯保罗
发表于 2019-8-25 20:23:17
for i in range(1,10):
for j in range(1,i+1):
print('%d*%d=%d' %(i,j,i*j),end=' ')
print()
九五二七
发表于 2019-10-30 21:11:39
for i in range(1,10):
for j in range(1,10):
if i>=j:
print(j,'X',i,'=',i*j,end=' ')
print(end='\n')
天下一统2014
发表于 2019-12-3 21:31:05
for i in range(1,10):
print(end = "\n")
for j in range(1,i+1):
print(("%d*%d=%d" % (i, j, i * j)).ljust(10),end ="")
ka233siji
发表于 2020-1-16 11:17:31
for i in range(1,10) :
for j in range(1,i+1) :
print(j,'*',i,'=',i*j,end='')
print('\n')
结果:
1 * 1 = 1
1 * 2 = 22 * 2 = 4
1 * 3 = 32 * 3 = 63 * 3 = 9
1 * 4 = 42 * 4 = 83 * 4 = 124 * 4 = 16
1 * 5 = 52 * 5 = 103 * 5 = 154 * 5 = 205 * 5 = 25
1 * 6 = 62 * 6 = 123 * 6 = 184 * 6 = 245 * 6 = 306 * 6 = 36
1 * 7 = 72 * 7 = 143 * 7 = 214 * 7 = 285 * 7 = 356 * 7 = 427 * 7 = 49
1 * 8 = 82 * 8 = 163 * 8 = 244 * 8 = 325 * 8 = 406 * 8 = 487 * 8 = 568 * 8 = 64
1 * 9 = 92 * 9 = 183 * 9 = 274 * 9 = 365 * 9 = 456 * 9 = 547 * 9 = 638 * 9 = 729 * 9 = 81
ouyunfu
发表于 2020-2-12 05:13:09
for i in range(1,10):
for j in range(1,i+1):
print('%d x %d = %2d ' % (j, i, i * j),end='')
print('\n')
xuanyuan0116
发表于 2020-2-22 12:31:26
print('----------每日练习题7----------')
#题目:输出 9*9 乘法口诀表
multiplier =
multiplicand =
product = []
print('\t1\t2\t3\t4\t5\t6\t7\t8\t9')
for i in multiplier:
for j in multiplicand:
print('%d * %d = %2d'%(i,j,i*j), end=' ')
print()
xiaofan1228
发表于 2020-2-29 16:51:50
a = 9
b = 9
for each_a in range(a):
if each_a != 0:
for each_b in range(b):
if each_b != 0:
if each_a >= each_b:
print("%d * %d = %d" %(each_a, each_b, each_a * each_b), end="" )
print("\n")
杜若左
发表于 2020-3-4 20:58:17
t = 0
for i in range(1,10):
for k in range(1,i+1):
print(str(i)+"*"+str(k)+"="+str(i*k)+' ',end='')
t =t+1
if t==i :
print("\n")
t=0
小生不才 献以粗鄙之见{:10_282:}
嘿嘿嘿的黑子哥
发表于 2020-3-24 15:54:01
for i in range(1,10):
for j in range(1,i+1):
print("{:d} * {:d} = {:2d}".format(j,i,j*i), end = "")
print()
一只235
发表于 2020-3-27 09:45:25
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
5*1=5 5*2=10 5*3=15 5*4=20 5*5=25
6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36
7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49
8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64
9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81
>>>
君子好逑
发表于 2020-4-4 15:20:28
for i in range(1,10):
for j in range (1,i+1):
print('%d*%d=%2d'%(j,i,i*j),end=' ')
if (i==j):
print()
1412849797
发表于 2020-4-12 09:59:54
for i in range(1,10):
for j in range(1,i+1):
print("{:.0f}*{:.0f}".format(j,i),end = "\t")
if i == j :
print("\n")
土二奇
发表于 2020-4-22 16:21:24
jerryxjr1220 发表于 2017-3-26 20:26
你这个打印不标准啊
99乘法表的标准输出是这样的:
1 x 1 =1
牛皮
尔东方
发表于 2020-4-27 17:56:26
for i in range(1,10):
for j in range(1,i+1):
print('{0}*{1}={2}'.format(i,j,i*j).ljust(6), end=' ')
print()
ForPorsche
发表于 2020-5-22 22:58:33
本帖最后由 ForPorsche 于 2020-5-22 23:01 编辑
for i in range(1, 10):
for j in range(1, i+1):
print('%d * %d = %-4d'%(i, j, i*j), end='')
print()
nononoyes
发表于 2020-5-29 14:53:51
'''
一行一行打印乘法表
关键知识点:
print默认是换行的,如果不想换行则需要加上print(end='');
这里为了格式对齐,使用了print(end='\t')
'''
for i in range(1,10):
for j in range(0,i):
print(j+1,"*",i,"=",(j+1)*i,end='\t')
print()
结果:
1 * 1 = 1
1 * 2 = 2 2 * 2 = 4
1 * 3 = 3 2 * 3 = 6 3 * 3 = 9
1 * 4 = 4 2 * 4 = 8 3 * 4 = 12 4 * 4 = 16
1 * 5 = 5 2 * 5 = 10 3 * 5 = 15 4 * 5 = 20 5 * 5 = 25
1 * 6 = 6 2 * 6 = 12 3 * 6 = 18 4 * 6 = 24 5 * 6 = 30 6 * 6 = 36
1 * 7 = 7 2 * 7 = 14 3 * 7 = 21 4 * 7 = 28 5 * 7 = 35 6 * 7 = 42 7 * 7 = 49
1 * 8 = 8 2 * 8 = 16 3 * 8 = 24 4 * 8 = 32 5 * 8 = 40 6 * 8 = 48 7 * 8 = 56 8 * 8 = 64
1 * 9 = 9 2 * 9 = 18 3 * 9 = 27 4 * 9 = 36 5 * 9 = 45 6 * 9 = 54 7 * 9 = 63 8 * 9 = 72 9 * 9 = 81
鲨鱼辣椒1
发表于 2020-7-24 17:53:58
total = "" # 创建了一个空字符串
for i in range(1,10):
for j in range(1,i+1): # (1,1+i)的好处是:不会输出多余的项,比如 2*1 就不会输出,只有 1*2
if i != j:
total = total + "{} * {} = {} ".format(i,j,i*j) # 对应于\n位置的空格,使得每次输出都增加了一个空格
else: # 如果 i和j 相同了,就换行
total = total + "{} * {} = {}\n".format(i,j,i*j) # \n:换行 字符串的"+"是拼接的作用
print(total)
想起飞吗
发表于 2020-9-14 21:09:12
for j in range(1,10):
for i in range(1,10):
if i>j:
pass
else:
if i==j:
print("%d * %d =%2d" % (i,j,i*j),end="\n")
else:
print("%d * %d =%2d" % (i,j,i*j),end=" ")
Wei_Jian_Xian
发表于 2020-10-24 11:23:47
text=''
for z in range(1,10):
for y in range(1,10):
text = text + f'{z}x{y}={z*y} '
if y > z:
text = text+'\n'
break
print(text)