1. Learn
  2. /
  3. Courses
  4. /
  5. Building Chatbots in Python

Exercise

EchoBot II

Having written your respond() function, you'll now define a function called send_message() with a single parameter message which logs the message and the bot's response.

Instructions

100 XP
  • Use the user_template string's .format() method to include the user's message into the user template, and print the result.
  • Call the respond() function with the message passed in and save the result as response.
  • Log the bot's response using the bot_template string's .format() method.
  • Send the message "hello" to the bot.