Skip to content

Commit c1552da

Browse files
committed
Merge branch 'master' of https://github.com/TwoWater/Python
2 parents e97782d + 29ae4ad commit c1552da

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python3/tuple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
tuple 不可变是指当你创建了 tuple 时候,它就不能改变了,也就是说它也没有 append(),insert() 这样的方法,但它也有获取某个索引值的方法,但是不能赋值。那么为什么要有 tuple 呢?那是因为 tuple 是不可变的,所以代码更安全。所以建议能用 tuple 代替 list 就尽量用 tuple 。
66

7-
## 1、创建 tuple(元祖 ##
7+
## 1、创建 tuple(元组 ##
88

99
元组创建很简单,只需要在括号中添加元素,并使用逗号隔开即可。
1010

python6/3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def sum(num1,num2):
1111
# 两数之和
12-
if not (isinstance (num1,(int ,float)) or isinstance (num2,(int ,float))):
12+
if not (isinstance (num1,(int ,float)) and isinstance (num2,(int ,float))):
1313
raise TypeError('参数类型错误')
1414
return num1+num2
1515

0 commit comments

Comments
 (0)