摘要: 1.namedtuple 命名元组 -> 类似创建一个类 from collections import namedtuple # 类 p = namedtuple("Point", ["x", "y","z"]) # 对象 p1 = p(10, 20,30) print(p1) print(p1. 阅读全文
posted @ 2018-12-27 20:53 杨洪涛 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1.简单的理解模块 写的每一个py文件都是一个模块,还有一些是我们一直在使用的模块. buildins: 内置模块. print, input random 主要是和随机相关的内容: random() 随机小数 ,是python中所有随机数的根, 随机小数0-1 uniform(a,b) a - b 阅读全文
posted @ 2018-12-27 20:52 杨洪涛 阅读(134) 评论(0) 推荐(0) 编辑