<PY><core python programming笔记>C4 Python对象
来源:互联网 发布:网络利大于弊的提问 编辑:程序博客网 时间:2024/05/18 08:32
C4 Python对象
4.1Python 对象
身份 类型 值
访问属性用 '.'操作
4.2标准类型
#类型查看 : type(obj)
数字
Integer
Boolean
Long integer
Floating point real number 5.3 5.0
Complex number
String 字符串
List 列表
Tuple 元组
Dictionary 字典
4.3其他内建类型
类型
None
文件
集合/固定集合
函数/方法
模块
类
#false: None False 0 0.0 0L 0.0+0.0j "" [] () {}
4.4内部类型
代码 #通过compile()可以得到代码对象 代码对象可被exec或eval()执行
帧
跟踪记录
切片
省略
Xrange
4.5标准类型操作符
4.5.1对象值比较
== <= >= > < !=
返回True 或False
4.5.2对象身份比较
is is not
作业:
4-8
列表和元组的区别:
列表跟数组不同的是,它可以改变元素的类型
4-9
a=10
b=10
e=10.0
f=10.0
>>>a is b
True
>>>e is f
False
>>>10.0 is 10.0
True
#因为浮点型了 便不再精确
0 0
- <PY><core python programming笔记>C4 Python对象
- <PY><core python programming笔记>C13 面向对象编程
- <PY><core python programming 笔记>C1 概述
- <PY><core python programming笔记>C5 数字
- <PY><core python programming笔记>C12 模块
- <PY><core python programming笔记>C3 Python基础
- <PY><core python programming笔记>C22 扩展Python
- <PY><core python programming笔记>C2 快速入门
- <PY><core python programming笔记>C7 字典和集合类型
- <PY><core python programming笔记>C8 条件与循环
- <PY><core python programming笔记>C9 文件和输入输出
- <PY><core python programming笔记>C10 错误和异常
- <PY><core python programming笔记>C14 执行环境
- <PY><core python programming笔记>C15 正则表达式
- <PY><core python programming笔记>C16 网络编程
- <PY><core python programming笔记>C17 网络客户端编程
- <PY><core python programming笔记>C18 多线程编程
- <PY><core python programming笔记>C19 图形用户界面编程
- github初体验
- ShareSDK分享记录
- 线程的调度-休眠
- ocx中fireevent注意要点
- V$LOCK 视图
- <PY><core python programming笔记>C4 Python对象
- 线程的同步与锁
- how to install the liunx ubuntu with U-disk
- 使用一个主表排序,副表记录当前访问的项移到副表的头-符号表
- 用C#制作PDF文件全攻略
- 线程的同步-同步方法
- 《JAVA NIO》之Channel类图
- C指针定义与内存分配(转载)
- 线程的同步-同步块