Build an Email Simulator - Step 8

Tell us what’s happening:

I use the method, then print the result but it does not work. Not sure what I am doing wrong here. Can you please guide me?

Your code so far

class Email:
    def __init__(self, sender, receiver, subject, body):
        self.sender = sender
        self.receiver = receiver
        self.subject = subject
        self.body = body
        self.read = False

    def mark_as_read(self):
        self.read = True


# User Editable Region

email_obj = Email('alice@example.com', 'bob@example.com', 'Hello', 'Hi Bob!')
print(email_obj.sender)
print(email_obj.subject)
print(email_obj.read)
email_obj.mark_as_read()
print(email_obj.mark_as_read())

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3.1 Safari/605.1.15

Challenge Information:

Build an Email Simulator - Step 8

Hi

Check this line again. Look how you previously did it

print(email_obj.mark_as_read())

I found the issue. No worries.

1 Like