Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Certified Racket AI Expert · Lesson 2 of 8

Module One

📖 Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
2
Module 1 · Racket AI Specialist

🔹 Module One · Welcome to Racket & Thinking Like a Computer

Certified Racket AI Specialist · Foundation

📖 Module Introduction

Hello, young explorer! 👋 Have you ever wondered how your video games work, or how a calculator knows that 2+2=4? In this module, we are going to learn the language of computers. We will use a special language called Racket. Racket is like a magic wand that lets us tell a computer what to do. By the end of this module, you will be able to write your very first computer programs, just like a real AI specialist! We'll start from the very beginning, so don't worry if you have never programmed before. This is your first step to becoming a Racket AI Specialist.

We will learn what a computer is, how it thinks, and how we can give it instructions using Racket. Think of it like learning a new language — but instead of talking to people, you will be talking to machines. And the best part? Machines always do exactly what you tell them (even if you make a mistake!).

🧠 Fun fact: Racket is used by real scientists to build artificial intelligence and smart systems!

🎯 Learning Objectives

By the end of this module, you will be able to:

  • ✔️ Explain what a computer is and what a program does.
  • ✔️ Understand why we use Racket for AI.
  • ✔️ Write your first Racket expressions (like 1+1).
  • ✔️ Use numbers and text in Racket.
  • ✔️ Spot the difference between a command and a question.
  • ✔️ Think like a programmer — break big problems into small pieces.
  • ✔️ Show confidence to continue learning more!

📚 Warm-up Story · The Robot Chef

Imagine you have a robot chef named Racky. Racky is super smart, but it only understands a special language. If you say, "Racky, please make me some jollof rice," Racky will just stare at you. But if you say exactly what to do, step by step, like: "Racky, take a pot. Put oil. Add tomatoes. Add rice. Cook for 20 minutes." — then Racky will make perfect jollof rice!

That is exactly what programming is. We give the computer (our robot) a list of clear, simple steps. The computer follows them without getting tired or bored. In this module, we will learn how to give instructions to the computer using Racket.

Let's meet Racket, the language that helps us talk to the computer. Just like learning "hello" and "goodbye" in a new language, we'll start with small words and build up to big, amazing programs.

   +-----------------+
   |   You (coder)   |
   +--------+--------+
            |
            |  (write Racket code)
            V
   +-----------------+
   |   Computer      |
   |  (Racket reads  |
   |   and follows)  |
   +-----------------+
            |
            V
   +-----------------+
   |  Result: answer,|
   |  drawing, game  |
   +-----------------+
  

🧩 Main Lessons

Lesson 1 · What is a Computer, Really?

Definition: A computer is a machine that follows instructions to do work. It can add numbers, show pictures, and play music — but only if we tell it how.

Why it matters: To be an AI specialist, you must understand what a computer can and cannot do.

Simple explanation: Think of a computer as a very fast, very dumb worker. It does exactly what you say, no more, no less. If you say "add 2 and 3", it answers 5. If you say "make a cake", it doesn't know what that means (unless you give it a cake recipe).

Real-life example: A calculator is a small computer. You press 2+3, it shows 5.

School example: In math class, your teacher gives you a problem; you solve it. A computer needs every single step.

Home example: When you set the microwave to 2 minutes and press start, the microwave follows that instruction exactly.

Nigerian example: Think of a POS machine. When you enter your PIN and amount, the machine follows the instructions to give you cash.

Illustration:

   [Your instruction]  --->  [Computer]  --->  [Result]
       "2 + 3"         --->    adds      --->     5
  
📌 Mini summary: A computer is a hardworking machine that follows instructions. We need to give it clear, small steps.

Lesson 2 · What is a Programming Language?

Definition: A programming language is a special way to write instructions that a computer can understand.

Why important: We cannot speak "computer" directly, so we use a programming language as a translator.

Simple explanation: Just like we use English, Yoruba, or Hausa to talk to people, we use a programming language to talk to computers. Racket is one of these languages.

Real-life: English, French, and Spanish are languages for people. Python, Racket, Java are languages for computers.

School: In your school, you might learn English, Maths, and Science. In programming, you learn a language like Racket.

Home: Your mum speaks to you in your mother tongue; you speak to the computer in Racket.

Nigerian: In Nigeria, we have many languages: Yoruba, Igbo, Hausa. Racket is just another language — but for computers.

Illustration:

   +-------------+      +----------------+      +-----------+
   |  You write  | ---> |  Racket reads  | ---> | Computer  |
   |  (+ 2 3)    |      |  and translates|      | answers 5 |
   +-------------+      +----------------+      +-----------+
  
📌 Mini summary: A programming language is like a bridge between you and the computer. Racket is our bridge.

Lesson 3 · Getting to Know Racket

Definition: Racket is a friendly programming language that is great for learning and for building smart AI systems.

Why Racket? It is simple, powerful, and teaches you to think clearly — exactly what an AI specialist needs.

Simple explanation: Racket is like a toy box. It has lots of tools (functions) to play with numbers, words, and even draw pictures.

Real-life: Many top universities use Racket to teach computer science.

School: Imagine if your maths teacher gave you a magic pen that could solve any problem. That's Racket.

Home: If you wanted to teach your younger sibling how to count, you would use simple words. Racket uses simple words too.

Nigerian: Racket is like the "Ube" (Pear) of programming languages — sweet, nutritious, and everyone can enjoy it.

Illustration:

   Racket language
         |
         V
   +-------------+
   |  ( + 5 3 )  |   -- means add 5 and 3
   +-------------+
         |
         V
      answer: 8
  
📌 Mini summary: Racket is a fun, clear language that helps us talk to computers. We will use it to build amazing things.

Lesson 4 · Numbers and Math in Racket

Definition: Numbers are the most basic things we use in Racket. We can add, subtract, multiply, and divide.

Why important: AI often uses math to make decisions — like scoring a game or predicting the weather.

Simple explanation: In Racket, we write math like this: (+ 2 3) means 2+3. The + is the operation, and the numbers are after it.

Real-life: When you buy a snack for 50 Naira and give 100 Naira, the cashier subtracts: 100 - 50 = 50.

School: In class, you write 3 + 4 = 7. In Racket, we write (+ 3 4) and it gives 7.

Home: If you have 5 oranges and eat 2, you have 3 left. In Racket: (- 5 2) → 3.

Nigerian: If you buy 10 sachets of water and share 4, you have 6 left. Racket: (- 10 4).

Illustration:

   (+ 2 3)   →   5
   (- 9 4)   →   5
   (* 2 3)   →   6
   (/ 10 2)  →   5
  
📌 Mini summary: Racket can do all kinds of math. We just put the operator first, then the numbers.

Lesson 5 · Words (Strings) in Racket

Definition: A string is a piece of text, like "Hello" or "Racket is fun". In Racket, we put quotes around strings.

Why it matters: AI systems often need to understand and generate text — like chatbots.

Simple explanation: If you want to say your name, you write "Chidi" in Racket. The quotes tell Racket this is a word, not a math instruction.

Real-life: When you send a text message, that's a string.

School: Your teacher might write "Good job!" on your work. That's a string.

Home: You might say "I love rice" — in Racket that is "I love rice".

Nigerian: "Jollof rice is delicious" — Racket stores it as "Jollof rice is delicious".

Illustration:

   "Hello"   →  a string
   "123"     →  a string (not a number)
   (+ 2 3)   →  math
   (+ "2" 3) →  error (can't mix string and number)
  
📌 Mini summary: Strings are text. We use quotes to tell Racket we mean words, not numbers.

Lesson 6 · The Racket Way of Thinking

Definition: In Racket, we write everything in a "prefix" style — the operator (like + or -) comes first, then the values.

Why it's cool: This makes Racket very consistent. Every instruction looks similar: (verb thing1 thing2 ...).

Simple explanation: Instead of saying "2 plus 3", we say "plus 2 3" — like Yoda from Star Wars! "Add you must, 2 and 3."

Real-life: Imagine giving commands to a robot: "Walk forward 2 steps" is like (walk 2).

School: When your teacher says "Read page 10", that's (read page 10) in Racket style.

Home: "Eat 3 bananas" → (eat 3 bananas).

Nigerian: "Buy 5 loaves of bread" → (buy 5 bread).

Illustration:

   English style:  2 + 3
   Racket style:   (+ 2 3)

   English:        "Hello" + " World"
   Racket:         (string-append "Hello" " World")
  
📌 Mini summary: In Racket, we always put the action first, then the things we act on.

Lesson 7 · Storing Things with Variables

Definition: A variable is like a box that holds a value. You can put a number or a string inside, and give it a name.

Why important: Variables let us remember things, so we can use them again later.

Simple explanation: Imagine you have a box labelled "age" and you put 10 inside. Now whenever you say age, Racket knows you mean 10.

Real-life: Your school bag has a name tag — that's like a variable. The contents are the value.

School: Your locker number stores your books.

Home: A jar labelled "sweets" — if you put 5 sweets in, the label tells you.

Nigerian: A "kolo" (piggy bank) with "savings" — when you put money in, the name tells you what it is.

Illustration:

   (define age 10)   ; creates a variable called age with value 10
   age   → 10
   (define name "Ade") ; variable name holds "Ade"
   name  → "Ade"
  
📌 Mini summary: Variables store information. We use define to create them.

Lesson 8 · Making Decisions (if statements)

Definition: An if statement lets the computer make choices: if something is true, do one thing; otherwise, do something else.

Why important: AI needs to make decisions — like if it's raining, carry an umbrella.

Simple explanation: If you are hungry, eat. Otherwise, play. Racket can do this too.

Real-life: If the traffic light is red, stop; if green, go.

School: If you score above 70, you get an A. Otherwise, you get a B.

Home: If you finish your homework, you can watch TV.

Nigerian: If the price of beans is cheap, buy more; otherwise, buy less.

Illustration:

   (if (< 5 10) "smaller" "bigger")  → "smaller"
   (if (> 5 10) "bigger" "smaller")  → "smaller"
  
📌 Mini summary: If helps the computer decide which path to take.

Lesson 9 · Creating Your Own Commands (Functions)

Definition: A function is a new command that you create. You give it a name and tell it what to do.

Why it matters: Functions let you reuse code. Once you make a command, you can use it many times.

Simple explanation: Imagine you invent a dance called "The Racket". You teach it to your friend once, then they can do it anytime.

Real-life: A recipe is like a function. Once you write it, you can cook the dish many times.

School: A maths formula like area = length × width is a function.

Home: A chore routine: "tidy room" means pick up toys, make bed.

Nigerian: "Make Jollof" — a function that includes steps: fry, add rice, cook.

Illustration:

   (define (square x) (* x x))   ; define a function to square a number
   (square 5)  → 25
   (square 3)  → 9
  
📌 Mini summary: Functions are your own custom commands. They make programming powerful.

Lesson 10 · Lists – Putting Things in Order

Definition: A list is a collection of things, like a shopping list. In Racket, we use ' (1 2 3).

Why important: AI often works with groups of data — like all the scores of a game.

Simple explanation: It's like a queue in school — everyone stands in a line.

Real-life: A grocery list: eggs, milk, bread.

School: A list of students in your class.

Home: A list of chores: sweep, dust, clean.

Nigerian: A list of items to buy at the market: yam, pepper, onions.

Illustration:

   '(1 2 3 4)          ; a list of numbers
   '("apple" "banana") ; a list of strings
   (first '(1 2 3))    → 1
   (rest '(1 2 3))     → (2 3)
  
📌 Mini summary: Lists hold multiple values in order. We can take the first or the rest.

Lesson 11 · Putting It All Together – Our First AI Program

We now know enough to write a tiny AI: a program that greets you and tells you if you can watch TV. Let's combine variables, if, and functions!

   (define name "Zainab")
   (define age 10)
   (define (can-watch-tv? age) (if (> age 8) "Yes, you may" "No, too young"))
   (string-append "Hello " name ", " (can-watch-tv? age))
   → "Hello Zainab, Yes, you may"
  

This is a real program! It uses a variable, a function, and an if statement. You just built a tiny AI!

📌 Mini summary: We can combine everything to make useful programs — this is the start of AI!

📖 Key Vocabulary

  • Computer: A machine that follows instructions.
  • Program: A set of instructions for the computer.
  • Racket: A programming language we use to talk to computers.
  • String: Text inside quotes, like "hello".
  • Variable: A box with a name that stores a value.
  • Function: A custom command you create.
  • List: A collection of items in order.
  • If statement: A way to make decisions in code.

🧠 Important Concepts

  • Precision: Computers are dumb — they need exact instructions.
  • Order: Instructions run one after another.
  • Abstraction: Hiding details inside functions.
  • Reuse: Functions let us reuse code again and again.

📘 Step-by-Step Explanations

How to write your first Racket program:

  1. Open Racket (DrRacket).
  2. Type (+ 5 6) in the interactions window.
  3. Press Enter. See 11 appear!
  4. Now type (define age 12).
  5. Type age — Racket shows 12.
  6. Type (define (double x) (* x 2)).
  7. Type (double 5) — you get 10!

🌍 Real-life Examples

  • ATMs: they follow instructions to dispense cash.
  • Traffic lights: they use decision logic (if green, go).
  • Spell-checkers: they look at lists of words.

🇳🇬 Nigerian Examples

  • Mobile banking apps: they use functions to transfer money.
  • Jollof rice recipe: a function that makes food.
  • School attendance: a list of student names.

🎈 Fun Examples

  • If you have 10 candies and eat 3, how many left? Racket: (- 10 3)
  • Make a variable called "bestFood" and set it to "Pizza".
  • Write a function called "shout" that takes a word and adds "!!!" at the end.

🏠 Everyday Examples

  • A recipe: functions.
  • A to-do list: lists.
  • An alarm clock: if time = 7am, ring.

🧑‍🏫 Teacher Notes

Encourage learners to type every example themselves. Relate everything to daily life. Use physical objects (like boxes for variables). Emphasize that mistakes are normal — debugging is part of the fun.

👪 Parent Tips

Ask your child to teach you what they learned. Let them show you how Racket adds numbers. Celebrate every small success. Learning to code is like learning a sport — practice, patience, and fun!

🌟 Interesting Facts

  • The first computer was as big as a room!
  • Racket was created by a team at a university.
  • AI can now play chess better than any human.

🤔 Did You Know?

Racket was originally made for teaching, so it's perfect for beginners like you. And many AI researchers use it to test new ideas!

🧾 Remember This

  • Computers follow instructions exactly.
  • Racket uses prefix notation: operator first.
  • Variables store things.
  • Functions let you create new commands.
  • Lists hold groups of things.

⚠️ Common Mistakes

  • Forgetting the quote around strings: "hello" not hello.
  • Using = instead of equal? for comparing.
  • Mixing up the order: (+ 2 3) is correct, (2 + 3) is not.
  • Forgetting to close parentheses: (+ 2 3 is missing a ).

✅ Best Practices

  • Always use descriptive names for variables: age not x.
  • Break big problems into small functions.
  • Test each small part before moving on.

📊 ASCII Illustrations

   +--------+      +--------+      +--------+
   |  Input | ---> | Racket | ---> | Output |
   +--------+      +--------+      +--------+
       ( + 5 3 )   computes         8
  
   Flow of a program:
   Start → Get Input → Process → Show Result → End
  

📋 Comparison Table

ConceptEnglish analogyRacket example
VariableBox with label(define age 12)
FunctionRecipe(define (square x) (* x x))
ListShopping list'(1 2 3)
IfDecision(if (> age 8) "big" "small")

📌 End-of-Module Summary

Wow! You've learned so much. You now know what a computer is, how to talk to it using Racket, how to use numbers and words, how to store things in variables, make decisions with if, create your own functions, and group things in lists. You've written your first tiny AI program. You are on your way to becoming a Certified Racket AI Specialist!

❓ Frequently Asked Questions (10)

  1. What is Racket? — A programming language for beginners and experts.
  2. Is Racket hard? — No! It's very friendly.
  3. Do I need a fast computer? — No, any computer works.
  4. Can I use Racket for games? — Yes, you can.
  5. Is Racket free? — Yes, completely free.
  6. What is a string? — Text inside quotes.
  7. What is a variable? — A named box for a value.
  8. What does (define) do? — It creates a variable or function.
  9. Can I make mistakes? — Yes, and it's okay. That's how we learn.
  10. What's next? — We'll learn more in Module Two!

📝 Review Questions (15)

  1. What is a computer?
  2. What is a programming language?
  3. What does (+ 3 4) do?
  4. How do you write "hello" in Racket?
  5. What is a variable?
  6. How do you create a variable named age with value 12?
  7. What is a function?
  8. Write a function that doubles a number.
  9. What is a list?
  10. How do you make a list of (1 2 3) in Racket?
  11. What does (if (> 5 3) "yes" "no") return?
  12. What is a string?
  13. Why is Racket good for beginners?
  14. What does (rest '(a b c)) return?
  15. Write a program that adds 5 and 7.

✏️ Fill-in-the-Blank

  1. A ______ is a machine that follows instructions.
  2. In Racket, text is written inside ______.
  3. The command to create a variable is ______.
  4. A ______ holds multiple values in order.
  5. The (if) statement helps us make ______.

✅ True or False

  1. Computers can think for themselves. (False)
  2. Racket uses prefix notation. (True)
  3. Strings are numbers. (False)
  4. Functions can reuse code. (True)
  5. Lists are not useful in AI. (False)

🔘 Multiple Choice (15)

  1. What does (+ 2 3) return? A) 5 B) 23 C) error D) 6 → A
  2. How do you write a string? A) "hello" B) hello C) 'hello D) (hello) → A
  3. Which creates a variable? A) (define x 5) B) (set x 5) C) (var x 5) D) (x 5) → A
  4. What is a function? A) A machine B) A command you make C) A number D) A list → B
  5. Which is a list? A) (1 2 3) B) [1 2 3] C) {1 2 3} D) "1 2 3" → A (with quote)
  6. What does (if (< 3 5) "small" "big") return? A) small B) big C) error D) 5 → A
  7. What is Racket? A) A game B) A programming language C) A food D) A country → B
  8. What does (first '(a b c)) return? A) a B) b C) c D) (a b c) → A
  9. What is a variable? A) A box with a name B) A number C) A string D) A list → A
  10. Can functions call other functions? A) Yes B) No C) Maybe D) Never → A
  11. What does (string-append "Hello" " World") do? A) Adds numbers B) Joins text C) Multiplies D) Error → B
  12. Which is NOT a Racket operator? A) + B) - C) * D) ÷ → D (uses /)
  13. What do we need to close after an expression? A) Parentheses B) Brackets C) Curly braces D) Quotes → A
  14. Is Racket free? A) Yes B) No C) Maybe D) Expensive → A
  15. What does (rest '(1 2 3)) return? A) 1 B) (2 3) C) (1 2) D) 3 → B

🔗 Matching Exercises

TermMatch
1. (define x 10)A. Function
2. (define (add a b) (+ a b))B. Variable
3. '(a b c)C. List
4. "hello"D. String

Answers: 1-B, 2-A, 3-C, 4-D

📝 Short Answer

  1. Explain what a computer does in your own words.
  2. Why do we use Racket?
  3. Give an example of a function you could make.

📖 Scenario-based Exercises

Scenario: You are building a simple bot for a shop. It should take the item price and quantity and calculate the total. How would you do it in Racket?

Answer: (define (total price qty) (* price qty))

👥 Group Activity

In groups of 3, pretend you are a computer. One person gives instructions like "(+ 4 5)", another computes the answer, and the third checks if it's correct. Take turns.

🧑‍💻 Individual Activity

Write a Racket expression that adds 10 and 20, multiplies the result by 2, and stores it in a variable called "result".

💬 Classroom Discussion Questions

  • Why is it important to give clear instructions to a computer?
  • Can you think of a real-life example where a computer makes a decision?
  • How is learning Racket similar to learning a new language?

🛠️ Mini Project

Create a simple "greeting bot" that asks for your name and says hello. Use a variable, a string, and display a message. (You can use (display) or just return a string.)

📋 Practical Assignment

Write a Racket program that takes your age and tells you if you are old enough to ride a rollercoaster (age > 12).

🏆 Challenge Exercise

Write a function that takes a list of numbers and returns the sum of all the numbers. (Hint: you can use recursion or the built-in (apply + list).)

🔑 Quiz Answers

Multiple choice answers: 1-A, 2-A, 3-A, 4-B, 5-A, 6-A, 7-B, 8-A, 9-A, 10-A, 11-B, 12-D, 13-A, 14-A, 15-B.

🎁 Key Takeaways

  • Computers need clear, exact instructions.
  • Racket is a fun and powerful language.
  • Variables store information.
  • Functions help us reuse code.
  • We made our first AI program!

🚀 Preparation for the Next Module

In Module Two, we will dive deeper into decision-making and start building more intelligent programs. We'll learn about logic, more math, and how to make our programs "remember" things. Get ready to create a tiny chatbot!

Before then, practice writing simple Racket expressions, create your own variables, and write at least three functions. The more you practice, the more it will stick.


🎉 You've completed Module One · Great job, future AI specialist! 🎉

🏆 Get Certified

🔒

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

🎓 Sign Up to Get Certified
🛠️ Practice Tools
Hands-on simulators & labs - subscription required.
→
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
→