Build an Email Simulator - Step 23

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

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-email-simulator/6853f2da9b8ed891e9fdc5fc.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @VisionWall

Which property of the sender and receiver do you want to print?

Happy coding

Ah, I was indeed missing something obvious. I used the name property of each object and passed. Strange that the AI hint didn’t see it and kept telling me there was something wrong with the tabs. Thank you for your help!

Hello @VisionWall I’ll look into this issue and see what happened. Like any other LLM powered system, Socrates is prone to mistakes and sometimes hallucinations. I’m continuously tuning the system prompt to circumvent these issues. I’ll keep you posted.