IT入门 > 面试题 > python题库 >

  • range and xrange

    日期:2019-07-25 23:46:58 点击:4593 好评:0

    都在循环时使用,xrange内存性能更好。 for i in range(0, 20): for i in xrange(0, 20):...

  • super init

    日期:2019-07-25 23:45:58 点击:2666 好评:0

    super() lets you avoid referring to the base class explicitly, which can be nice. But the main advantage comes with multiple inheritance, where all sorts of fun stuff can happen. See the standard docs on super if you haven't already. Note t...

  • Python2和3的区别

    日期:2019-07-25 23:45:07 点击:2568 好评:0

    推荐:[Python 2.7.x 与 Python 3.x 的主要差异](http://chenqx.github.io/2014/11/10/Key-differences-between-Python-2-7-x-and-Python-3-x/)...

  • read,readline和readlines

    日期:2019-07-25 23:44:29 点击:3224 好评:0

    * read 读取整个文件 * readline 读取下一行,使用生成器方法 * readlines 读取整个文件到一个迭代器以供我们遍历...

  • Python的is

    日期:2019-07-25 23:43:37 点击:6253 好评:0

    is是对比地址,==是对比值...

  • Python的List

    日期:2019-07-25 23:37:35 点击:7065 好评:0

    推荐: http://www.jianshu.com/p/J4U6rR 在Python中list特别有用。让我们来看下list的内部是如何实现的。 来看下面简单的程序,在list中添加一些整数并将他们打印出来。 L = []L.append(1)L.append(2)L....

  • Python垃圾回收机制

    日期:2019-07-25 23:35:23 点击:4821 好评:0

    Python GC主要使用引用计数(reference counting)来跟踪和回收垃圾。在引用计数的基础上,通过“标记-清除”(mark and sweep)解决容器对象可能产生的循环引用问题,通过“分代回收”(...

  • Python里的拷贝

    日期:2019-07-25 23:34:10 点击:3118 好评:0

    引用和copy(),deepcopy()的区别 import copya = [1, 2, 3, 4, ['a', 'b']] #原始对象b = a #赋值,传对象的引用c = copy.copy(a) #对象拷贝,浅拷贝d = copy.deepcopy(a) #对象拷贝,深拷贝a.append(5) #修改对象aa[4...

  • Python函数式编程

    日期:2019-07-25 23:32:19 点击:993 好评:0

    这个需要适当的了解一下吧,毕竟函数式编程在Python中也做了引用. 推荐: [酷壳](http://coolshell.cn/articles/10822.html) python中函数式编程支持: filter 函数的功能相当于过滤器。调用一个布尔函数...

  • lambda函数

    日期:2019-07-25 23:31:44 点击:2456 好评:0

    其实就是一个匿名函数,为什么叫lambda?因为和后面的函数式编程有关. 推荐: [知乎](http://www.zhihu.com/question/20125256)...

广告位API接口通信错误,查看德得广告获取帮助