Python interview_python】的更多相关文章

https://github.com/taizilongxu/interview_python 1 Python的函数参数传递 strings, tuples, 和numbers是不可更改的对象,而list,dict等则是可以修改的对象 2 Python中的元类(metaclass) 3 @staticmethod和@classmethod python 三个方法,静态方法(staticmethod),类方法(classmethod),实例方法 4 类变量和实例变量 类变量就是供类使用的变量,实…
https://github.com/taizilongxu/interview_python 1 Python的函数参数传递 strings, tuples, 和numbers是不可更改的对象,而list,dict等则是可以修改的对象…
The Python Tutorial (Python 2.7.11) 的中文翻译版本.Python Tutorial 为初学 Python 必备官方教程,本教程适用于 Python 2.7.X 系列. 在线阅读 » Fork Me » The Python Tutorial (Python 3.5.1) 的中文翻译版本.Python Tutorial 为初学 Python 必备官方教程,本教程适用于 Python 3.5.x. 在线阅读 » Fork Me » Flask 是一个轻量级的 We…
1 Python的函数参数传递 看两个例子: a = 1 def fun(a): a = 2 fun(a) print a # 1 a = [] def fun(a): a.append(1) fun(a) print a # [1] 所有的变量都可以理解是内存中一个对象的“引用”,或者,也可以看似c中void*的感觉. 这里记住的是类型是属于对象的,而不是变量.而对象有两种,“可更改”(mutable)与“不可更改”(immutable)对象. 在python中,strings, tuples…
这里有个重要概念呢在下面那个链接 http://blog.csdn.net/zimou5581/article/details/53053775 http://www.cnblogs.com/btchenguang/archive/2012/09/17/2689146.html 1.新式类都从object继承,经典类不需要. 2.新式类的MRO(method resolution order 基类搜索顺序)算法采用C3算法广度优先搜索,而旧式类的MRO算法是采用深度优先搜索 3.新式类相同父类只…
source code https://github.com/haoran119/interview/tree/master/interview%20summary%20of%20python [ZZ]知名互联网公司Python的16道经典面试题及答案 - 浩然119 - 博客园 https://www.cnblogs.com/pegasus923/p/8674215.html 百度大牛总结十条Python面试题陷阱,看看你是否会中招 - Python编程 https://mp.weixin.q…
1. 简单测试局域网中的电脑是否连通.这些电脑的ip范围从192.168.0.101到192.168.0.200 import subprocess cmd="cmd.exe" begin=101 end=200 while begin<end: p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) p.stdin.write…
原文链接-https://github.com/taizilongxu/interview_python Python语言特性 1 Python的函数参数传递 2 Python中的元类(metaclass) 3 @staticmethod和@classmethod 4 类变量和实例变量 5 Python自省 6 字典推导式 7 Python中单下划线和双下划线 8 字符串格式化:%和.format 9 迭代器和生成器 10 *args and **kwargs 11 面向切面编程AOP和装饰器…
1. 关于函数传参 def func(n, *args, **kwargs): print n print args print kwargs if __name__ == '__main__': # func(2, 5,7,9, m = 1, q = 0) n = 2 args = (5, 7, 9) kwargs = {'m':1, 'q':0} func(n, args, kwargs) func(n, *args, **kwargs) func(n=n, args=args, kwarg…
python知识点链接:https://github.com/taizilongxu/interview_python 搜索:python最佳事件 书单:http://lucida.me/blog/developer-reading-list/#python 代码2大全,重构,程序员修炼之道,软件开发路线图 x = 0.5 while x != 1.0 print(x)    # 0.5 0.5 0.5 一直循环 x += 0.1 查浮点数比较相等的情况,x != 1.0 这样程序并不会结束 因…