摘要:
一.面向对象三大特性封装 (把多个方法都需要的参数放在init方法中) class f1(object): def __init__(self,name,age,adress,country): self.name=name self.age=age self.adress=adress self. 阅读全文
摘要:
1.字符串 2.运算符 !=不等于 ==等于 <=小于等于 a in b 判断a是否包含于b,即b是否包含a a not in b 判断a是否不包含于b,即b不包含a a+=1 即a=a+1 a-=1 即a=a-1 and 且 or 或 %2 取余 3.ascii码 unIcode码 utf-8码 阅读全文
摘要:
#1 #类变量与实例变量的区别 class foo: country='中国' def __new__(cls, *args, **kwargs): print('这是构造方法') return object.__new__(cls) #返回开辟的内存空间地址 def __init__(self,name): self... 阅读全文