From e4fae2749b0d685727a442cfecc0757062a86429 Mon Sep 17 00:00:00 2001 From: JJJZXY <1522844911@qq.com> Date: Mon, 11 Jan 2021 09:56:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=9C=9F=E8=AE=AD=E7=BB=83=E8=90=A5/5?= =?UTF-8?q?=E7=8F=AD/5=E7=8F=AD=5F=E5=BC=A0=E5=85=B4=E9=9B=A8/=E7=AC=AC?= =?UTF-8?q?=E5=9B=9B=E5=91=A8=E4=BD=9C=E4=B8=9A.01.04-01.10/=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\211\350\212\202\344\275\234\344\270\232" | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 "\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" 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 994add79..00000000 --- "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}电影") - -- Gitee