Code a Compliment Generator

Celebrate CS Ed Week with this fun and simple coding activity!

Description:
Spread positivity and creativity by coding a Compliment Generator! This activity is perfect for beginners and introduces basic programming concepts like lists and randomization in a fun, engaging way.


Step 1: Choose Your Tools
You can complete this activity using tools like:

  • Scratch
  • code.org
  • Python (via an online IDE)

Step 2: Build Your Compliment Generator

  1. Start with a List of Compliments:

    • Brainstorm a list of positive messages, e.g.,
      • “You’re a creative thinker!”
      • “You light up the room!”
      • “You’re a great problem-solver!”
  2. Add Randomization:

    • Use code to randomly select one compliment from the list whenever the program runs.

Sample Code (for Python):

import random

# List of compliments
compliments = [
    "You’re a creative thinker!",
    "You light up the room!",
    "You’re a great problem-solver!",
    "You inspire others!",
    "You’re doing great—keep going!"
]

# Randomly select a compliment
print("Here's a compliment for you:")
print(random.choice(compliments))

Step 3: Make It Your Own!
Encourage students to add their personal touches:

  • Add animations in Scratch.
  • Include colorful designs or interactive buttons.
  • Let the compliments be spoken aloud with text-to-speech tools.

Share Your Success!
We’d love to see what your students create. Share your programs and celebrate the positivity using the hashtags #CSEdWeek and #CodeYourFuture.

Last Updated: Jul 8, 2025 10:57 AM