摘要: 五个函数如下abs(), coerce(), divmod(), pow(),和 round()下面是实战演练abs()返回给定参数的绝对值。如果参数是一个复数,那么就返回 math.sqrt(num.real2 + num.imag2)。函数 coerce(),尽管从技术上讲它是一个数据类型转换函... 阅读全文
posted @ 2014-12-18 20:40 batch.me 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 之前面试py web后端开发被问到如何反转一个数据(?不知道如何表达)想到了切片示例:>>> mystr = 'shiving2014'>>> mylist = ['s','h','i','v',2,0,1,4]>>> mytuple = ('s','h','i','v',2,0,1,4)>>> >... 阅读全文
posted @ 2014-12-18 13:34 batch.me 阅读(394) 评论(0) 推荐(0) 编辑