Build an Email Simulator - Step 18

Tell us what’s happening:

I called the method, but still got the error → You should call alice.send_email() with the correct parameters.
Please guide me what is wrong.

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

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)


# User Editable Region

alice = User("Alice")
bob = User("Bob")

alice.send_email(bob, "Hello", "Hi bob, how are you?")

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build an Email Simulator - Step 18

make sure this is the string you are asked to use

Yes, the step asking this →
Use Alice’s send_email method to send Bob an email with subject "Hello" and body "Hi Bob, how are you?".

I didn’t know, but i reset the lesson and i tried this, it works out →

alice = User(“Alice”)

bob = User(“Bob”)

alice.send_email(bob,‘Hello’,‘Hi Bob, how are you?’)

***

Thanks for the response

notice how you were writing bob instead in the string, that’s why it wasn’t passing

Now i got it :laughing:
That’s my bad and on the second try, i copy paste the text from instruction. So that’s how the code passed.
Thanks :raising_hands: