diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/5\347\217\255/5\347\217\255_\345\274\240\345\205\264\351\233\250/\347\254\254\345\233\233\345\221\250\344\275\234\344\270\232.01.04-01.10/\347\254\254\344\270\211\350\212\202\344\275\234\344\270\232" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/5\347\217\255/5\347\217\255_\345\274\240\345\205\264\351\233\250/\347\254\254\345\233\233\345\221\250\344\275\234\344\270\232.01.04-01.10/\347\254\254\344\270\211\350\212\202\344\275\234\344\270\232" deleted file mode 100644 index 994add79af7bdc8500acd823fc36af8ed873bb78..0000000000000000000000000000000000000000 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/5\347\217\255/5\347\217\255_\345\274\240\345\205\264\351\233\250/\347\254\254\345\233\233\345\221\250\344\275\234\344\270\232.01.04-01.10/\347\254\254\344\270\211\350\212\202\344\275\234\344\270\232" +++ /dev/null @@ -1,59 +0,0 @@ -# 实例改为静态方法 - -class MyMath: - @staticmethod - def add(a, b): - return a + b - def sub(a, b): - return a - b - def mul(a, b): - return a * b - def div(a, b): - return a / b - def mi(a, b): - return a ** b - def sqrt(a, b): - return a**(1 / 2) - -print(MyMath.add(1,2)) - - -#添加属性 -class movie(): - nation = "China" #添加类属性 - __ticket = 30 # 添加类私有属性 - - def __init__(self,act): - self.p = act - -金刚川 = movie("动作") -print(f"《金刚川》是一部{金刚川.p}电影") - -哪吒 = movie("动漫") -print(f"《哪吒》是一部{哪吒.p}电影") - -# 添加类方法 -print("-------------------------") -class movie(): - def __init__(self,act): - self.p = act - - @classmethod - def __new__(cls, *args, **kwargs): - return super().__new__(cls) - -金刚川 = movie("动作") -print(金刚川.p) - -print("-------------------------") -#在__init__方法中初始化实例属性 -#在__init__方法中绑定私有实例属性 - -class movie(): - def __init__(self,act): - self.act = act - __act = "电影类型" - -金刚川 = movie("动作") -print(f"《金刚川》是一部{金刚川.act}电影") -