1 Star 0 Fork 0

dzc/Python-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
multiplication_table.py 561 Bytes
一键复制 编辑 原始数据 按行查看 历史
abdelrahman tarek 提交于 2018-09-09 02:12 +08:00 . Update multiplication_table.py
from sys import argv # import argment variable
script, rows, columns = argv # define rows and columns for the table and assign them to the argument variable
def table(rows, columns):
for i in range(1, int(rows) + 1 ): # it's safe to assume that the user would mean 12 rows when they provide 12 as an argument, b'coz 12 will produce 11 rows
print ("\t", i,)
print ("\n\n") # add 3 lines
for i in range(1, int(columns) + 1 ):
print (i),
for j in range(1, int(rows) + 1 ):
print ("\t",i*j,)
print ("\n\n") # add 3 lines
table(rows, columns)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sdredboy/Python-1.git
git@gitee.com:sdredboy/Python-1.git
sdredboy
Python-1
Python-1
master

搜索帮助