CS Ed Week Compliment Generator Activity - Department of Computer Science - Purdue University Skip to main content

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: Dec 3, 2024 11:11 AM

Department of Computer Science, 305 N. University Street, West Lafayette, IN 47907

Purdue University Indianapolis, 723 W. Michigan St., Indianapolis, IN 46202

Phone: (765) 494-6010 • Fax: (765) 494-0739

Copyright © 2024 Purdue University | An equal access/equal opportunity university | Copyright Complaints | DOE Degree Scorecards

Trouble with this page? Accessibility issues? Please contact the College of Science.