python学习-乘法口诀
2016-12-05 19:18
134 查看
# reference : introduction to programming using python(Y.Daniel Liang)
正方形形状的表现方法(乘法口诀中有重复项)
print(' Multiplication Table')
# display the number title
print(' ',end=' ')
for j in range(1,10):
print(' ',j,end='')
print()# jump to the new line
print('--------------------------------------------------')
for i in range(1,10):
print(i,'|',end=' ')
for j in range(1,10):
print(format(i*j,"4d"),end=' ')
print()
三角形形状的表现方法
for i in range(1,10):
for j in range(1,10):
if (j<=i):
print(format(i,'2d'),'×',format(j,'2d'),'=',format(i*j,'2d'),' ',end=' ')
print()
正方形形状的表现方法(乘法口诀中有重复项)
print(' Multiplication Table')
# display the number title
print(' ',end=' ')
for j in range(1,10):
print(' ',j,end='')
print()# jump to the new line
print('--------------------------------------------------')
for i in range(1,10):
print(i,'|',end=' ')
for j in range(1,10):
print(format(i*j,"4d"),end=' ')
print()
三角形形状的表现方法
for i in range(1,10):
for j in range(1,10):
if (j<=i):
print(format(i,'2d'),'×',format(j,'2d'),'=',format(i*j,'2d'),' ',end=' ')
print()
相关文章推荐
- python学习:99乘法口诀
- 刚学习python 写的乘法口诀
- python 乘法口诀
- Python打印乘法口诀
- 学习python:练习1.乘法表
- python 学习--99乘法表
- [置顶] 用python和java打印乘法口诀的区别
- 学习python 第一季:编写简单乘法运算题
- Python3统计字符串、乘法口诀实例
- python实现9*9乘法口诀
- Python2.7学习笔记-矩阵乘法matrix vs. ndarray ; dot vs. inner,
- python 学习1阶段 编写简单乘法运算
- 黑马程序员 - 学习笔记3 乘法口诀 水仙花数
- python输出乘法口诀
- 【Java学习之代码学习】 Prog06_九九乘法口诀问题
- 学习python 之编写简单乘法运算题
- Java学习笔记8:用键盘输入1~9,列出相对应的乘法口诀
- Java学习笔记7:改变赋值,输出乘法口诀
- 我的第一个Python程序--99乘法口诀
- python实现九九乘法口诀