摘要:
阅读全文
摘要:
阅读全文
摘要:
阅读全文
摘要:
# 1.自定义异常类, 继承Exception, 魔法方法有init和str(设置异常描述信息)class ShortInputError(Exception): def __init__(self, length, min_len): # 用户输入的密码长度 self.length = lengt 阅读全文
摘要:
阅读全文
摘要:
阅读全文
摘要:
阅读全文
摘要:
# 在python中,获取和修改私有属性值# 一般定义函数名get_xx set_xx用来修改私有属性值class Master(object): def __init__(self): self.kongfu = '[师父方法]' def cake(self): print(f'运用{self.k 阅读全文
摘要:
class Master(object): def __init__(self): self.kongfu = '[师父方法]' def cake(self): print(f'运用{self.kongfu}来实现')class School(Master): def __init__(self): 阅读全文
摘要:
class Master(object): def __init__(self): self.kongfu = '[师父方法]' def make_cake(self): print(f'运用{self.kongfu}来实现')class School(object): def __init__(s 阅读全文