Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
Python
提交
c1552da0
P
Python
项目概览
OpenDocCN
/
Python
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Python
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c1552da0
编写于
1月 23, 2018
作者:
3
347073565@qq.com
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/TwoWater/Python
上级
e97782dd
29ae4add
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
2 deletion
+2
-2
python3/tuple.md
python3/tuple.md
+1
-1
python6/3.md
python6/3.md
+1
-1
未找到文件。
python3/tuple.md
浏览文件 @
c1552da0
...
...
@@ -4,7 +4,7 @@
tuple 不可变是指当你创建了 tuple 时候,它就不能改变了,也就是说它也没有 append(),insert() 这样的方法,但它也有获取某个索引值的方法,但是不能赋值。那么为什么要有 tuple 呢?那是因为 tuple 是不可变的,所以代码更安全。所以建议能用 tuple 代替 list 就尽量用 tuple 。
## 1、创建 tuple(元
祖
) ##
## 1、创建 tuple(元
组
) ##
元组创建很简单,只需要在括号中添加元素,并使用逗号隔开即可。
...
...
python6/3.md
浏览文件 @
c1552da0
...
...
@@ -9,7 +9,7 @@
def
sum
(
num1
,
num2
):
# 两数之和
if
not
(
isinstance
(
num1
,(
int
,
float
))
or
isinstance
(
num2
,(
int
,
float
))):
if
not
(
isinstance
(
num1
,(
int
,
float
))
and
isinstance
(
num2
,(
int
,
float
))):
raise
TypeError
(
'参数类型错误'
)
return
num1
+
num2
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录