Learn
Live Stream

Alienbot

The 1950s ushered in a slew of UFO sightings and excitement about outer space. Incidentally, the decade also brought about a new idea of artificial intelligence. The computer scientist Alan Turing proposed that if a computer was able to fool a human into believing it was human, the computer would be considered "intelligent."

While your bot may not pass a true Turing test, perhaps it could pass an "E.T.uring" test if you can successfully fool a human into believing that your chatbot is, in fact, an alien.

We've added some code to get you started; you'll be digging into the main chatbot functionality. Take a look at what you have in script.py:

  • the regex and random libraries are imported
  • a tuple of negative responses (you can add more!)
  • a tuple of commands for a user to exit the program
  • a tuple of random starter questions an alien might ask (feel free to add more)
  • a variable name assigned an empty string value
  • a really wild-looking tuple of dictionaries called alienbabble with the chatbot's main response pairs — you'll add to this later!
  • several spaces for functions you'll add:
    • greet() will greet the user
    • make_exit() will check if a user has used an exit command
    • alienbot() will run the program allowing users to chat with the alien you created
    • converse() will match the response pairs in alienbabble for you
  • a reflections dictionary of pronouns and verbs to be swapped in alien responses
  • reflect() switches the user's words for the alien's response
Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.