- 博客(3)
- 收藏
- 关注
原创 命名元组 collections.namedtuple
>>> import collections >>> Sale = collections.namedtuple("Sale", "productid customerid date quantity price") >>> sales1 = Sale(1,1,'2012-01-01', 100, 100) >>> print("{date}".format(**sales1._asdi
2012-04-27 11:36:05
291
原创 str.format
{field_name!conversion:format_specification} 字段名 ... 转换 s 强制使用字符串形式 r 强制使用表象形式 a 强制使用表象形式,但仅限于ASCII字符 格式规范 : fill align sign # 0 width , . precision
2012-04-26 20:03:38
244
原创 区分出两个浮点数最小区别
sys.float_info.epsilon def is_float_equal(a, b): return abs(a - b)
2012-04-26 13:34:51
1019
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人