BytesIO | 零基礎輕鬆看懂 C# TCP客戶端(完整原始碼+視訊教程)
阿新 • • 發佈:2022-05-28
user.py
class Users: def __init__(self, name='guest', password='111111', status=1): self.name = name self.password = password self.status = status def info(self): if self.status == 1: print(self.name, ',', self.password, ',', '賬戶正常') else: print('封禁賬號') self.status = 0 def modify_password(self): if self.status == 1: for i in range(0,3): if self.password == input('輸入舊密碼:'): self.password = input('輸入新密碼:') break else: i+= 1 if i == 2: print('賬戶已鎖,請稍後再試') Users.status = 0
task5.py
from user import Users class Admin(Users): def __init__(self, name='admin', password='999999', status=1): super().__init__(name, password, status) def info(self): super().info() def ban_user(self, users): users.status= 0 def unblock_user(self, users): users.status = 1 def reset_password(self, users): users.password = input('重置密碼:')