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

Exercise

EchoBot I

Hello, World!

You'll begin learning how to build chatbots in Python by writing two functions to build the simplest bot possible: EchoBot. EchoBot just responds by replying with the same message it receives.

In this exercise, you'll define a function that responds to a user's message. In the next exercise, you'll complete EchoBot by writing a function to send a message to the bot.

Instructions

100 XP
  • Write a function called respond() with a single parameter message which returns the bot's response. To do this, concatenate the strings "I can hear you! You said: " and message.
  • Store the concatenated strings in bot_message, and return this result.