class UserManager:
def __init__(self):
self.users = {}
def add_user(self, username, email):
self.users[username] = {'username': username, 'email': email}
def get_email(self, username):
return self.users.get(username, {}).get('email', 'Email not found')
# Как использовать это класс
manager = UserManager()
manager.add_user('user1', 'user1@example.com')
manager.add_user('user2', 'user2@example.com')
print(manager.get_email('user1'))
print(manager.get_email('user2'))
print(manager.get_email('user3'))