摘要: sys.stdout sys.stdin 阅读全文
posted @ 2017-11-04 21:43 S3c0ldW4ng 阅读(176) 评论(0) 推荐(0)
摘要: #!/usr/bin/python # -*- encoding:utf-8 -*- # lambda parameter_list: expression f = lambda x,y: x + y print f(1,2) # 3 #等同与下面的函数定义 def g(x, y): return x + y 阅读全文
posted @ 2017-11-04 19:12 S3c0ldW4ng 阅读(158) 评论(0) 推荐(0)
摘要: #!/usr/bin/python # -*- encoding:utf-8 -*- class Animal: animal_num = 0 class Dog(Animal): #类帮助文档 'this is help' #两个下划线开头,类的私有属性,不能在类外部访问,类内部使用self.__dog_name访问 __Dog_name = 'dah... 阅读全文
posted @ 2017-11-04 15:02 S3c0ldW4ng 阅读(181) 评论(0) 推荐(0)