Python 编程实用技巧

文章目录 1、小数保留指定位小数 1.%f 方法 2.format函数 3.round()函数 4.直接截断 2、判断变量的数据类型的两种方法 1.type(): 2.isinstance() 3、python中的类方法(@classmethod) 4、str.format与制表符\t关于中文对齐 1、小数保留指定位小数 1.%f 方法 f = 1.23456 f1 = '%.4f' % f f2
相关文章
相关标签/搜索