提交 0ac95d9a 编写于 作者: W wizardforcel

2020-07-08 20:57:49

上级 de5bb18b
# Python 程序:将两个矩阵相乘
# Python 程序:将两个矩阵相乘
> 原文: [https://www.programiz.com/python-programming/examples/multiply-matrix](https://www.programiz.com/python-programming/examples/multiply-matrix)
......
......@@ -133,7 +133,7 @@ A diagram of different namespaces in Python
在任何给定时刻,至少有三个嵌套作用域。
1. 具有本地名称的当前函数的范围
1. 具有局部名称的当前函数的范围
2. 具有全局名称的模块的范围
3. 具有内置名称的最外部作用域
......
......@@ -25,7 +25,7 @@ def function_name(parameters):
1. 关键字`def`,用于标记函数头的开始。
2. 用于唯一标识功能的功能名称。 函数命名遵循相同的[规则,即在 Python](/python-programming/keywords-identifier#rules) 中编写标识符。
3. 通过其将值传递给函数的参数(参数)。 它们是可选的。
4. 冒号(:)标记函数头的结尾。
4. 冒号(`:`标记函数头的结尾。
5. 可选的文档字符串(docstring),用于描述函数的功能。
6. 组成函数体的一个或多个有效 python 语句。 语句必须具有相同的缩进级别(通常为 4 个空格)。
7. 可选的`return`语句,用于从函数返回值。
......
......@@ -105,7 +105,7 @@ RecursionError: maximum recursion depth exceeded
1. 递归函数使代码看起来干净整洁。
2. 可以使用递归将复杂的任务分解为更简单的子问题。
3. 使用递归比使用嵌套嵌套更容易生成序列。
3. 使用递归比使用嵌套更容易生成序列。
* * *
......
......@@ -159,7 +159,7 @@ print(constant.GRAVITY)
current_salary
```
4. 使用可能的大写字母声明一个常数。 例如:
4. 尽可能使用大写字母声明一个常数。 例如:
```py
PI
......
......@@ -12,7 +12,7 @@
* * *
## 示例:公里英里
## 示例:公里英里
```py
# Taking kilometers input from the user
......
......@@ -24,7 +24,7 @@ abcd... = an + bn + cn + dn + ...
```
## 源代码:检查阿姆斯特朗数(3 位数字)
## 源代码:检查 3 位阿姆斯特朗数
```py
# Python program to check if the number is an Armstrong number or not
......@@ -70,7 +70,7 @@ Enter a number: 407
最后,我们将总和与原始数字进行比较,得出结论,如果它们相等,则为阿姆斯特朗数字。
## 源代码:检查阿姆斯特朗的 n 位数字
## 源代码:检查 n 位阿姆斯特朗数
```py
num = 1634
......
......@@ -99,7 +99,7 @@
+ [Python 程序:使用递归将十进制转换为二进制](102.md)
+ [Python 程序:相加两个矩阵](103.md)
+ [Python 程序:转置矩阵](104.md)
+ [Python 程序:将两个矩阵相乘](105.md)
+ [Python 程序:将两个矩阵相乘](105.md)
+ [Python 程序:检查字符串是否为回文](106.md)
+ [Python 程序:从字符串中删除标点符号](107.md)
+ [Python 程序:按字母顺序对单词进行排序](108.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册