Unit 7: Programming

⭐ 5-Minute Coding Challenge: Build a Mini Chatbot

Students will:

  • Write their first Python program
  • Make the computer respond to their words
  • Add simple logic in under 5 minutes

All using OneCompiler (Chromebook-friendly).

🟦 STEP 1 β€” Open OneCompiler

Tell students:

  1. Go to https://onecompiler.com/python
  2. You’re ready β€” no setup, no logins.

🟦 STEP 2 β€” Generate the Base Program Using AI

Have students paste this into ChatGPT:

Prompt:
Write the simplest Python program that asks the user their favorite food and prints a fun response. Keep it extremely simple.

ChatGPT will return something like this:

Students should:

  1. Paste the code into OneCompiler
  2. Click Run

πŸŽ‰ The chatbot responds.

🟦 STEP 3 β€” Add Logic (Make It Smarter)

Now have students send ChatGPT this:

Prompt:
Now add simple logic: if the food is pizza, print a special funny message. Otherwise print a default message.

ChatGPT will return something like:

Students:

  • Paste
  • Run
  • Done

Now the chatbot responds differently depending on what they type.

🟦 STEP 4 β€” Personalize It (Make It Yours)

Tell students:

β€œMake your chatbot react to something you love.”

Prompt:

Change the program so it reacts to my favorite thing (my hobby, game, sport, etc.) and add emojis.

Suddenly, every student’s code is unique πŸŽ¨πŸš€