2018年7月9日

python2与python3的区别

摘要: 1,源码规范区别 Python2:,,源码不规范,源码混乱,重复代码较多。 Python3,重整源码,源码规范,优美,清晰,简单。 2,print区别 input 字符串数据类型 python3x : print('内容') python2x : print('内容')或者print‘内容’ 3,编 阅读全文

posted @ 2018-07-09 21:32 liangliang123456 阅读(156) 评论(0) 推荐(0) 编辑

collections random模块

摘要: tu = (1,2) print(tu[0],tu[1]) from collections import namedtuple point = namedtuple('Point',['x','y']) p = point(10,30) # p = (x=10,y=30) print(p.x) p 阅读全文

posted @ 2018-07-09 20:55 liangliang123456 阅读(196) 评论(0) 推荐(0) 编辑

导航