Build Your First AI Agent / Chapter 1: Hello, Bot
Feedback
Quest

04. Echo Echo

input() lets your bot ask a question and wait. Whatever the player types comes back as text.

pet = input("Favourite pet? ")
print(pet.upper())
print(pet + "!")
Favourite pet? cat
CAT
cat!

.upper() makes text shout. + glues two pieces of text together. When you click Run, a box pops up so you can type. When you Submit, the checker types hey for you.

Instructions

  1. Ask with input("Say something: ") and store the answer in word.
  2. Print word in capitals with .upper().
  3. Print word twice with one space between, like hey hey.
Hint

word.upper() gives capitals. word + " " + word glues it twice with a space in the middle.

Solution
word = input("Say something: ")
print(word.upper())
print(word + " " + word)
Still stuck?

Press "Talk it out" at the top. Our Discord opens soon; until then email us and paste your code.

Chapter quests
  1. Chapter 1: Hello, Bot
    1. Wake Up 10 XP
    2. Name Tag 10 XP
    3. Mood Ring 10 XP
    4. Echo Echo 10 XP
    5. Snack Counter 15 XP
  2. Chapter 2: Talk to the Model
  3. Chapter 3: Tools CLUB
  4. Chapter 4: Memory CLUB
  5. Chapter 5: Loops and Plans CLUB
  6. Chapter 6: Party of Agents CLUB
bot.py
Terminal
Chapter 1: Hello, BotQuest 4 / 510 XPBackNext

Talk it out

  1. What did you expect your bot to do?
  2. What did it actually print? Read the terminal, line by line.
  3. What's different? Spelling, capitals, spaces and full stops all count.
  4. Is there an error? It tells you the line number. Look there first.
  5. Read the instructions again, one at a time. Each one is checked on its own.

Badge unlocked:

Your bot got a new part. Chapter complete!

Make your bot

Pick a name and a colour. You can change them later.