Tell us what’s happening:
I added the two print statements to display_full_email as instructed (lines 15 and 16), but can’t progress even though I tested it and they both work.
The AI hint tells me that the two print statements are not properly inside the function, but they clearly are. I created two Email objects and called display_full_email and both print statements ran for both of them, and appeared to produce the expected results, so those print statements must correctly be inside display_full_email.
Is this step bugged, or am I missing something obvious?
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
def display_full_email(self):
self.mark_as_read()
print('\n--- Email ---')
# User Editable Region
print(f'From: {self.sender}')
print(f'To: {self.receiver}')
# User Editable Region
class User:
def __init__(self, name):
self.name = name
self.inbox = Inbox()
def send_email(self, receiver, subject, body):
email = Email(sender=self, receiver=receiver, subject=subject, body=body)
receiver.inbox.receive_email(email)
class Inbox:
def __init__(self):
self.emails = []
def receive_email(self, email):
self.emails.append(email)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:159.0) Gecko/20100101 Firefox/159.0
Challenge Information:
Build an Email Simulator - Step 23