Upon updating a value, the __init__ method still uses the old attribute value.
class Email:
def __init__(self, name):
self.name = na
The simplest fix would be to make email a property, rather than an attribute you set in __init__.
class Email:
def __init__(self, name):
self.name = name
# self.email = self.name + "@hotmail.com"
@property
def email(self):
return f'{self.name}@hotmail.com'
def details(self):
return f'{self.name} | {self.email}'