From b899d0b3fb08d246cc44f8d9bffb786c7d3d1924 Mon Sep 17 00:00:00 2001 From: Flowey <1586447080@qq.com> Date: Wed, 10 Mar 2021 00:02:59 +0800 Subject: [PATCH] =?UTF-8?q?3=E7=8F=AD=5F=20Flowey=5F=E7=AC=AC=E5=9B=9B?= =?UTF-8?q?=E5=91=A8=203=E7=8F=AD=5F=20Flowey=5F=E7=AC=AC=E5=9B=9B?= =?UTF-8?q?=E5=91=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50\347\254\254\344\270\200\350\212\202.py" | 31 ++++++++++++ ...50\347\254\254\344\270\211\350\212\202.py" | 40 +++++++++++++++ ...50\347\254\254\344\272\214\350\212\202.py" | 50 +++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\200\350\212\202.py" create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\211\350\212\202.py" create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\272\214\350\212\202.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\200\350\212\202.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\200\350\212\202.py" new file mode 100644 index 00000000..aaf9f97b --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\200\350\212\202.py" @@ -0,0 +1,31 @@ +import datetime +#datetime->str +now = datetime.datetime.now() +print(now) +now = now.strftime("%Y-%m-%d %H-%M-%S") +print(now) +#str->datetime +a = datetime.datetime.now() +b = a.strftime("%Y-%m-%d %H:%M:%S") +c = datetime.datetime.strptime(b,"%Y-%m-%d %H:%M:%S") +print(c) +#datetime->timestamp +a = datetime.datetime.now() +b = a.timestamp() +print(b) + +#输出时间 +def shijian(): + a = input(("输入-1获取当前时间:")) + if a == "-1": + now = datetime.datetime.now() + now = now.strftime("%Y-%m-%d") + print(now) + else: + print("输入错误") + + +shijian() + + + diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\211\350\212\202.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\211\350\212\202.py" new file mode 100644 index 00000000..c3d84b71 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\270\211\350\212\202.py" @@ -0,0 +1,40 @@ +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 squ(a, b): + return a ** b + + def sqrt(a): + return float(a ** (1 / 2)) + + +print(Mymath.sub(10, 4)) + + + +class badminton: + __stature = 25 + def __init__(self, a, b, c): + self.ball = a + self.battledore = b + self._player = c + + + @classmethod + def money(cls): + print("总共100元") + return cls.money + +badminton.money() +print(badminton._badminton__stature) \ 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/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\272\214\350\212\202.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\272\214\350\212\202.py" new file mode 100644 index 00000000..d48ad166 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/3\347\217\255/3\347\217\255_Flowey/\347\254\254\345\233\233\345\221\250\347\254\254\344\272\214\350\212\202.py" @@ -0,0 +1,50 @@ +class Mymath: + def add(self, a, b): + return a + b + + def sub(self, a, b): + return a - b + + def mul(self, a, b): + return a * b + + def div(self, a, b): + return a / b + + def squ(self, a, b): + return a ** b + + def sqrt(self, a): + return float(a ** (1 / 2)) + + +result = Mymath() +print(result.sub(10, 4)) + + +class badminton: + def __init__(self, a, b, c): + self.ball = a + self.battledore = b + self.player = c + + def play(self): + print(f"{self.player}打球,用{self.battledore}打{self.ball}") + + +play_1 = badminton("羽毛球", "尤尼克斯", "林丹") +print(play_1.play()) + + + +class battledore(badminton): + def banshu(self): + print("25磅") + +class YONEX(badminton): + def pingpai(self): + print("尤尼克斯") + +a = battledore("羽毛球", "尤尼克斯", "林丹") +print(f"{a.player}") +a.banshu() \ No newline at end of file -- Gitee