From 9f0f9aeb776208e0fbd886c4e32153a33a008076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sat, 9 Jan 2021 23:52:40 +0800 Subject: [PATCH 01/11] =?UTF-8?q?1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85?= =?UTF-8?q?=5F=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC=E4=B8=80=E8=8A=82?= =?UTF-8?q?=E8=AF=BE=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- ...02\350\257\276\344\275\234\344\270\232.py" | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git a/.gitignore b/.gitignore index 26bfa0f6..b00581cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/venv/ \ No newline at end of file +/venv/ +/.idea/ \ No newline at end of file diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..cef104d8 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,23 @@ +def fib1(num): + results = [0, 1] + for i in range(num): + result = results[0] + results[1] + results[0] = results[1] + results[1] = result + return results[1] + + +def fib2(num): + results = [0, 1] + i = 0 + while i < num: + result = results[0] + results[1] + results[0] = results[1] + results[1] = result + i = i + 1 + return results[1] + + +if __name__ == '__main__': + print(fib1(100)) + print(fib2(100)) \ No newline at end of file -- Gitee From a68e2c58d8e890034d1ad9fd7a35279746a49d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 00:18:53 +0800 Subject: [PATCH 02/11] =?UTF-8?q?1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85?= =?UTF-8?q?=5F=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC=E8=8A=82=E4=BA=8C?= =?UTF-8?q?=E8=AF=BE=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...02\350\257\276\344\275\234\344\270\232.py" | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..b8c84fec --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,41 @@ +classes = [ + {"name": "n_1", "age": 24, "grade": "A"}, + {"name": "n_2", "age": 23, "grade": "B"}, + {"name": "n_3", "age": 28, "grade": "A"}, + {"name": "n_4", "age": 24, "grade": "A"}, + {"name": "n_5", "age": 25, "grade": "C"}, + {"name": "n_6", "age": 21, "grade": "D"}, + {"name": "n_7", "age": 27, "grade": "A"}, +] + + +def choose_grade(item): + return item['grade'] == 'A' + + +grade_a_list = filter(choose_grade, classes) +for i in grade_a_list: + print(i) + + +def add_age(item): + item["age"] = item["age"] + 1 + return item + + +new_classes = map(add_age, classes) + + +for i in new_classes: + print(i) + + +def fib(n): + if n == 1: + return 1 + if n == 2: + return 1 + return fib(n-1) + fib(n-2) + + +print(fib(10)) \ No newline at end of file -- Gitee From 222a91cdaa9f2efb78432ad2b6fcdf1a90a292ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 00:46:09 +0800 Subject: [PATCH 03/11] =?UTF-8?q?1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85?= =?UTF-8?q?=5F=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC=E8=8A=82=E4=B8=89?= =?UTF-8?q?=E8=AF=BE=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...02\350\257\276\344\275\234\344\270\232.py" | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..6bba3d9b --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,44 @@ +from datetime import datetime + + +def print_time(func): + def wrapper(): + print("Run time: {}".format(datetime.now())) + return func() + + return wrapper + + +@print_time +def foo(): + print("I am foo") + + +foo() + + +def cache(func): + _cached = {} + + def wrapper(n): + if n in _cached: + return _cached[n] + else: + result = func(n) + _cached[n] = result + return result + + return wrapper + + +@cache +def fib(n): + if n == 1: + return 1 + if n == 2: + return 1 + + return fib(n-2) + fib(n-1) + + +print(fib(100)) \ No newline at end of file -- Gitee From 59f1a16903deb29571c37f1841c14a18bd6c6977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 23:42:26 +0800 Subject: [PATCH 04/11] =?UTF-8?q?1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85?= =?UTF-8?q?=5F=E7=AC=AC=E5=9B=9B=E5=91=A8-=E7=AC=AC=E8=8A=82=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...02\350\257\276\344\275\234\344\270\232.py" | 15 +++++ ...02\350\257\276\344\275\234\344\270\232.py" | 63 +++++++++++++++++++ ...02\350\257\276\344\275\234\344\270\232.py" | 49 +++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..dc2ad7d7 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\200\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,15 @@ +import datetime + +now = datetime.datetime.now() +print(now.timestamp()) +print(now.strftime("%Y-%m-%d %H:%M:%S")) + + +def get_date(day_delta): + base_date = datetime.datetime(2021, 1, 3) + target_date = base_date + datetime.timedelta(days=day_delta) + return target_date.strftime("%Y-%m-%d") + + +print(get_date(-1)) +print(get_date(1)) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..e871264e --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,63 @@ +class MyMath: + @classmethod + def add(cls, a, b): + return a + b + + @classmethod + def minus(cls, a, b): + return a - b + + @classmethod + def multi(cls, a, b): + return a * b + + @classmethod + def div(cls, a, b): + return a / b + + @classmethod + def pow(cls, a, b): + return a ** b + + @classmethod + def sqrt(cls, a): + return a ** 0.5 + + +print(MyMath.add(1, 2)) +print(MyMath.minus(1, 2)) +print(MyMath.multi(1, 2)) +print(MyMath.div(1, 2)) +print(MyMath.pow(3, 2)) +print(MyMath.sqrt(2)) + + +class Person: + prop = 'Person Property' + __prop = 'Private Person Property' + + def __init__(self, name, age): + self.__name = name + self.__age = age + + @classmethod + def print_props(cls): + print('Prop: {}, Private Prop: {}'.format(cls.prop, cls.__prop)) + + def __str__(self): + return ''.format(self.__name, self.__age) + + +class Student(Person): + def __init__(self, name, age, class_no): + super().__init__(name, age) + self.__class_no = class_no + + +Person.print_props() + +mike = Student('Mike', 23, 1) +jame = Student('Jame', 22, 2) + +print(mike) +print(jame) \ No newline at end of file diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..fb037a14 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,49 @@ +class MyMath: + def add(self, a, b): + return a + b + + def minus(self, a, b): + return a - b + + def multi(self, a, b): + return a * b + + def div(self, a, b): + return a / b + + def pow(self, a, b): + return a ** b + + def sqrt(self, a): + return a ** 0.5 + + +my_math = MyMath() +print(my_math.add(1, 2)) +print(my_math.minus(1, 2)) +print(my_math.multi(1, 2)) +print(my_math.div(1, 2)) +print(my_math.pow(3, 2)) +print(my_math.sqrt(2)) + + +class Person: + def __init__(self, name, age): + self.name = name + self.age = age + + def introduce(self): + print('My name is {}, my age is {}'.format(self.name, self.age)) + + +class Student(Person): + def __init__(self, name, age, class_no): + super().__init__(name, age) + self.class_no = class_no + + +mike = Student('Mike', 23, 1) +jame = Student('Jame', 22, 2) + +mike.introduce() +jame.introduce() \ No newline at end of file -- Gitee From 7364990aab9d74b65069e07db687c4ec4682ca9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 23:46:40 +0800 Subject: [PATCH 05/11] =?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/1?= =?UTF-8?q?=E7=8F=AD/1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85/1=E7=8F=AD?= =?UTF-8?q?=5F=E6=9E=97=E6=B5=B7=E6=B8=85=5F=E7=AC=AC=E5=9B=9B=E5=91=A8-?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E8=8A=82=E8=AF=BE=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...02\350\257\276\344\275\234\344\270\232.py" | 49 ------------------- 1 file changed, 49 deletions(-) delete mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" deleted file mode 100644 index fb037a14..00000000 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" +++ /dev/null @@ -1,49 +0,0 @@ -class MyMath: - def add(self, a, b): - return a + b - - def minus(self, a, b): - return a - b - - def multi(self, a, b): - return a * b - - def div(self, a, b): - return a / b - - def pow(self, a, b): - return a ** b - - def sqrt(self, a): - return a ** 0.5 - - -my_math = MyMath() -print(my_math.add(1, 2)) -print(my_math.minus(1, 2)) -print(my_math.multi(1, 2)) -print(my_math.div(1, 2)) -print(my_math.pow(3, 2)) -print(my_math.sqrt(2)) - - -class Person: - def __init__(self, name, age): - self.name = name - self.age = age - - def introduce(self): - print('My name is {}, my age is {}'.format(self.name, self.age)) - - -class Student(Person): - def __init__(self, name, age, class_no): - super().__init__(name, age) - self.class_no = class_no - - -mike = Student('Mike', 23, 1) -jame = Student('Jame', 22, 2) - -mike.introduce() -jame.introduce() \ No newline at end of file -- Gitee From da77b12b3f06f727ddec460566abd80559a76571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 23:46:50 +0800 Subject: [PATCH 06/11] =?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/1?= =?UTF-8?q?=E7=8F=AD/1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85/1=E7=8F=AD?= =?UTF-8?q?=5F=E6=9E=97=E6=B5=B7=E6=B8=85=5F=E7=AC=AC=E5=9B=9B=E5=91=A8-?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E8=8A=82=E8=AF=BE=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...02\350\257\276\344\275\234\344\270\232.py" | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" deleted file mode 100644 index e871264e..00000000 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" +++ /dev/null @@ -1,63 +0,0 @@ -class MyMath: - @classmethod - def add(cls, a, b): - return a + b - - @classmethod - def minus(cls, a, b): - return a - b - - @classmethod - def multi(cls, a, b): - return a * b - - @classmethod - def div(cls, a, b): - return a / b - - @classmethod - def pow(cls, a, b): - return a ** b - - @classmethod - def sqrt(cls, a): - return a ** 0.5 - - -print(MyMath.add(1, 2)) -print(MyMath.minus(1, 2)) -print(MyMath.multi(1, 2)) -print(MyMath.div(1, 2)) -print(MyMath.pow(3, 2)) -print(MyMath.sqrt(2)) - - -class Person: - prop = 'Person Property' - __prop = 'Private Person Property' - - def __init__(self, name, age): - self.__name = name - self.__age = age - - @classmethod - def print_props(cls): - print('Prop: {}, Private Prop: {}'.format(cls.prop, cls.__prop)) - - def __str__(self): - return ''.format(self.__name, self.__age) - - -class Student(Person): - def __init__(self, name, age, class_no): - super().__init__(name, age) - self.__class_no = class_no - - -Person.print_props() - -mike = Student('Mike', 23, 1) -jame = Student('Jame', 22, 2) - -print(mike) -print(jame) \ No newline at end of file -- Gitee From 7e17f2dc681f481e2d66dfe3abe0624d89c85afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 23:55:51 +0800 Subject: [PATCH 07/11] =?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/.DS=5FSt?= =?UTF-8?q?ore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.DS_Store" | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/.DS_Store" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/.DS_Store" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/.DS_Store" deleted file mode 100644 index 0ef9e307ed53671736eb9011be3d7a56f089ebd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!EVz)5Z!fCvI(l115$fI+6%V`*=dW^1Ckrcp*JKWH~?yG61A3GZxuU4G!62- zUr>I6@8}owEBF9TFta;EN({FMp=w5&eY3l7#@gp(*DHjO{qZ0Wq9cS*;D}xenm-uM zqu0!%ktU$T8cAjnh_ToK%`yDn3gEl*L{NM`%FM^5_xJRtHM;;$^lF@MFjM0slj4Hv z+$I-UT9m$jC%v`C`h%uYZPngre~8Y^Br4-_T=e77JM6uR%d>>y*T!V?I8NTA!^v^y z(F>E8aheZDHaQ&(f%5)snh(sRZ^rqcuyrCgp;Sw?jyv1a>AoLyb+SML%MVr*Tf46D~B#!NV|XI3a|o;3aq(q2habP@L&GR{eLlud#nH}aIX}Qjl<}$4@;u6wYE4sYc==@I2!UQ nhw~H&>`@F{Jc_r$t--j)05Bx19Kr|~e+XC^xM2nUsRF+MQ*4Kl -- Gitee From d70b56febd6e295ecd37dacba7196abbfc6adfe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Sun, 10 Jan 2021 23:55:58 +0800 Subject: [PATCH 08/11] =?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/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/.keep" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/.keep" deleted file mode 100644 index e69de29b..00000000 -- Gitee From ac89c4757e02814a57530cf974deac40ad9c4bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=99=BD?= Date: Mon, 11 Jan 2021 00:00:41 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20.D?= =?UTF-8?q?S=5FStore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index d14b280e97c8a189d7bbbaf36d4bee8cb9f919bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKPiqrF6n~S(WHut^P_P$qF1>}asUq}H*rv%LpryE?f=avVhIV1QQ<9CLT~qep zErPc~`yE8TgC{?MA4lK(F*J<|y@-_e;LY#NoA;Y#f3um%003(Zqb5Kd064nBl7r1} zOpPm_vy#nJ5SgB13w-Ew6Zs}g=Bg?2KPsTst_qK!3!Bh^3+pFC9Kp|m-9=pap-sPl z15dDW1KRKyaRm+_GAll1OfE4hd1LFt-o44EldtcWXKUf}-)h6r;4n<|yx+pZBpzh0 z`<;~*$~P)i&TG7OtM=O8mm@z5vf-c=^k1spc989dHhwB)GL3`qS=<}#)E75pngwy% z>uYix^|0jC^Ei#L~v^I>@T|#k$ zMbBbk5J%9Mp&}Y8vsVme=$IF_&a+q;G<0D0^1Qeakr z1=Fpo^S|@w`~NJ7dZYj;aIF+z<+k5$;Vap*b?)WVSu4js6H|8K@xz{;2{#0S< Date: Mon, 11 Jan 2021 14:26:44 +0800 Subject: [PATCH 10/11] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20=E7=AC=AC=E4=BA=8C=E6=9C=9F=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E8=90=A5/1=E7=8F=AD/1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85/1?= =?UTF-8?q?=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85=5F=E7=AC=AC=E5=9B=9B?= =?UTF-8?q?=E5=91=A8-=E7=AC=AC=E4=B8=89=E8=8A=82=E8=AF=BE=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A.py"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit da77b12b3f06f727ddec460566abd80559a76571. --- ...02\350\257\276\344\275\234\344\270\232.py" | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..e871264e --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\270\211\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,63 @@ +class MyMath: + @classmethod + def add(cls, a, b): + return a + b + + @classmethod + def minus(cls, a, b): + return a - b + + @classmethod + def multi(cls, a, b): + return a * b + + @classmethod + def div(cls, a, b): + return a / b + + @classmethod + def pow(cls, a, b): + return a ** b + + @classmethod + def sqrt(cls, a): + return a ** 0.5 + + +print(MyMath.add(1, 2)) +print(MyMath.minus(1, 2)) +print(MyMath.multi(1, 2)) +print(MyMath.div(1, 2)) +print(MyMath.pow(3, 2)) +print(MyMath.sqrt(2)) + + +class Person: + prop = 'Person Property' + __prop = 'Private Person Property' + + def __init__(self, name, age): + self.__name = name + self.__age = age + + @classmethod + def print_props(cls): + print('Prop: {}, Private Prop: {}'.format(cls.prop, cls.__prop)) + + def __str__(self): + return ''.format(self.__name, self.__age) + + +class Student(Person): + def __init__(self, name, age, class_no): + super().__init__(name, age) + self.__class_no = class_no + + +Person.print_props() + +mike = Student('Mike', 23, 1) +jame = Student('Jame', 22, 2) + +print(mike) +print(jame) \ No newline at end of file -- Gitee From 5b4c97e9ba8d23c1ac526a91822a869618ed663d Mon Sep 17 00:00:00 2001 From: shwbai Date: Mon, 11 Jan 2021 14:27:14 +0800 Subject: [PATCH 11/11] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20=E7=AC=AC=E4=BA=8C=E6=9C=9F=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E8=90=A5/1=E7=8F=AD/1=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85/1?= =?UTF-8?q?=E7=8F=AD=5F=E6=9E=97=E6=B5=B7=E6=B8=85=5F=E7=AC=AC=E5=9B=9B?= =?UTF-8?q?=E5=91=A8-=E7=AC=AC=E4=BA=8C=E8=8A=82=E8=AF=BE=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A.py"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7364990aab9d74b65069e07db687c4ec4682ca9b. --- ...02\350\257\276\344\275\234\344\270\232.py" | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" new file mode 100644 index 00000000..fb037a14 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/1\347\217\255/1\347\217\255_\346\236\227\346\265\267\346\270\205/1\347\217\255_\346\236\227\346\265\267\346\270\205_\347\254\254\345\233\233\345\221\250-\347\254\254\344\272\214\350\212\202\350\257\276\344\275\234\344\270\232.py" @@ -0,0 +1,49 @@ +class MyMath: + def add(self, a, b): + return a + b + + def minus(self, a, b): + return a - b + + def multi(self, a, b): + return a * b + + def div(self, a, b): + return a / b + + def pow(self, a, b): + return a ** b + + def sqrt(self, a): + return a ** 0.5 + + +my_math = MyMath() +print(my_math.add(1, 2)) +print(my_math.minus(1, 2)) +print(my_math.multi(1, 2)) +print(my_math.div(1, 2)) +print(my_math.pow(3, 2)) +print(my_math.sqrt(2)) + + +class Person: + def __init__(self, name, age): + self.name = name + self.age = age + + def introduce(self): + print('My name is {}, my age is {}'.format(self.name, self.age)) + + +class Student(Person): + def __init__(self, name, age, class_no): + super().__init__(name, age) + self.class_no = class_no + + +mike = Student('Mike', 23, 1) +jame = Student('Jame', 22, 2) + +mike.introduce() +jame.introduce() \ No newline at end of file -- Gitee