# 方法一,用嵌套for循环实现99乘法表
def one_question01():
for i in range(1,10):
for j in range(1, i+1):
print('{}*{}={}'.format(i, j, i*j), end='\t')
print('\n')
one_question01()
# 方法二,用嵌套while循环实现99乘法表
def one_question02():
index = 1
while index <= 9:
i = 1
while i <= index:
print('{}*{}={}'.format(index, i, i*index), end='\t')
i += 1
print('\n')
index += 1
# one_question02()
# 方法三,用while嵌套for循环实现99乘法表
def one_question03():
index=1
while index <= 9:
for i in range(1, index+1):
print('{}*{}={}'.format(index, i, i*index), end='\t')
print('\n')
index += 1
# one_question03()
# 方法四,用for嵌套while循环实现99乘法表
def one_question04():
for index in range(1, 10):
i = 1
while i <= index:
print('{}*{}={}'.format(index, i, i*index), end='\t')
i += 1
print('\n')
index += 1
# one_question04()
# 方法五
def one_question05():
print('\n'.join(['\t'.join(["{}*{}={}".format(j, i, i * j)
for j in range(1, i + 1)])
for i in range(1, 10)]))
# one_question05()
99乘法表的五种实现方式还在继续研究其他方法中,基础是重中之重,作为小白的我要勤加努力,打好基础# 方法一,用嵌套for循环实现99乘法表def one_question01(): for i in range(1,10): for j in range(1, i+1): print('{}*{}={}'.format(i, j, i*j),...