Beautiful is better than ugly. Explicit is better than implicit. Simple ...

收录了13篇文章 · 3人关注
Beautiful is better than ugly. Explicit is better than implicit. Simple ...
method 在一个类中,可能出现三种方法,实例方法、静态方法和类方法,下面来看看三种方法的不同。 实例方法instance method 实例...
“_”和” __”的使用 更多的是一种规范/约定,不没有真正达到限制的目的: “_”:以单下划线开头的表示的是protected类型的变量,即只...
def fs(lst,fil) f=lambda x:not any(p in x for p in fil) return list(filt...
list = ["a", "b", "c"]#可修改数组 dictionary = {"a": 0, "b": 1, "c": 2}#hash表...
decor()仅仅是一个自己定义的函数,@才是使用的核心。 def decor(func): def wrap(): print("...
(1) try: f = open("filename.txt") text=f.read() finally: f.close() ...
nums = [55, 44, 33, 22, 11] if all([i > 5 for i in nums]): print("All ...
is是判断地址相同,==是判断值相同 a=1 b=a print(b is a)#True print(a is b)#True print(b...
专题公告
life is short, i need Python!