Harvard University Chat Service Project
Question Description
I’m working on a python exercise and need an explanation and answer to help me learn.
Create a simple chat service
- The service has three users: alice, bob, charlie
- A user has username and contacts
- A user can send and receive messages from his/her contacts
example:
alice = User('alice') # create the other users, toochat_service.add_user(alice) # add the other users, tooalice.add_contact(bob)alice.add_contact(charlie)bob.accept_contact(alice)alice.send_message(bob, 'Hello!')bob.send_message(alice, 'Supp!')alice.send_message(charlie, 'Hi') # Fails. alice is not in charlie's contact.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."