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 0000000000000000000000000000000000000000..aaf9f97b8215f46d281aad7b1a4491193b3da89a --- /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 0000000000000000000000000000000000000000..c3d84b71fc471877f054ba08c45d34e2a96e62f1 --- /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 0000000000000000000000000000000000000000..d48ad1669c88cf29750ecbfe0e694a30e22a6c35 --- /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