摘要:
# ==和is # ==用来判断值是否相等# is是用看来判断是不是指定了同一个东西,判断是不是指向了同一个地址等 a = [11,22,33]b = [11,22,33] a == b # Truea is b # False print(id(a)) print(id(b)) c = aprin 阅读全文
摘要:
用法一: class Test(object): def __init__(self): # 私有化 self.__num = 100 #名字重整_Test__num def setNum(self,newNum): print(" setter") self.__num = newNum def 阅读全文