class User():
def __init__(self,first_name,last_name,login_attempts):
self.first_name=first_name
self.last_name=last_name
self.login_attempts=login_attempts
def describe_user(self):
print('there are some information about users:')
def greet_user(self):
print('Hello, '+self.first_name+self.last_name)
def increment_login_attempts(self):
self.login_attempts+=1
def reset_login_attempts(self):
self.login_attempts=0
class Admin(User):
def __init__(self,first_name,last_name,login_attempts):
super().__init__(first_name,last_name,login_attempts)
privileges=["can add post" ,"can delete post" ,"can ban user"]
self.privileges=Privileges()
class Privileges():
def __init__(self):
self.privileges=["can add post" ,"can delete post" ,"can ban user"]
def show_privileges(self):
print(self.privileges)
import user
**my_user=user.**Admin('yang','xiaowen','66')
my_user.privileges.show_privileges()