← SC in Schools Python

say() function

A custom function that speaks text aloud using text-to-speech; the first argument is the text to speak and the second argument is the voice number

Understanding say() function in SC in Schools Python

What it does: The number 2 in say("Welcome!", 2) is the voice number — it tells the function which voice to use. say() and print() produce different types of output — audio versus visible text in the console. say() always needs two arguments: the text to speak and the voice number to use. say() must be called with parentheses wrapping both arguments. Using different voice numbers for different say() calls lets you create a two-speaker conversation. say() must be written in all lowercase. Say() with a capital S will cause an error. say() takes a string and a voice number, then speaks the string aloud through the computer's speakers.

Common mistakes: The closing quote is missing from the string. It should be say("See you later!", 1) with a closing quote and a voice number. Line 2 is wrong. say() must be called with parentheses. say "Hi again!", 1 is missing the brackets around the arguments. Line 3 is wrong.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 64–73) and word search (Modules 64–73).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How many arguments does say() require?
Two — text and a voice numberOne — just the text
Matches
say("Goodbye!")
↓
Wrong — say() requires two arguments: the text and a voice number
Applying
Meanings
Term
say()
Meaning
A custom function that speaks text aloud using text-to-speech; the first argument is the text to speak and the second argument is the voice number
Practice
say("Hello! What is your name?", 1)
Testing
Gaps
("Hello there!", 1)
Check Answer
Spots
2say("Thanks!", 2)
3say("See you later!)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Zebra' badge — Pattern Matcher, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How many arguments does say() require?
A. Two — text and a voice number ✓
B. One — just the text
say() always needs two arguments: the text to speak and the voice number to use.
2. Which of these is the correct way to call say()?
A. say "Hello!", 1
B. say("Hello!", 1) ✓
say() must be called with parentheses wrapping both arguments.
3. What does the second argument in say() control?
A. Which voice speaks the text ✓
B. How many times the text is spoken
The second argument is a voice number that selects which text-to-speech voice is used.
4. say() displays text in the console panel.
A. False ✓
B. True
say() speaks text aloud through the speakers — it does not display anything in the console. That is what print() does.
5. Can you use different voice numbers in one program to represent different speakers?
A. No — only one voice number is allowed per program
B. Yes — use a different number for each speaker ✓
Using different voice numbers for different say() calls lets you create a two-speaker conversation.

Match the Pairs

say("Hello!", 1) → Speaks the text Hello! aloud using voice number 1
say("Hi!", 1) say("Hey!", 2) → A two-speaker conversation using different voice numbers
The second argument in say() selects the voice → say("Welcome!", 2)
say() produces spoken audio; print() shows text in the console → say("I am spoken", 1) print("I am visible")
say("Goodbye!") → Wrong — say() requires two arguments: the text and a voice number
Say("Hello!", 1) → Wrong — say() must be all lowercase; Say() with a capital S is not recognised

Key Term

say()
A custom function that speaks text aloud using text-to-speech; the first argument is the text to speak and the second argument is the voice number

Fill in the Blanks

1. say("Hello there!", 1)
Hint: Type the name of the function that speaks text aloud
2. say("Good morning!", 1)
Hint: Type a voice number to choose which voice speaks this line
3. say("Hello!", 1) say("Hi back!", 2)
Hint: Type the function name that makes the second line speak aloud
4. say("How are you?", 2)
Hint: Type a different voice number to represent a second speaker
5. say("Goodbye!", 1) # This uses say for audio output
Hint: Type the function name used for spoken audio output

Spot the Error

Question 1
A say("Welcome!", 1)
B say("Thanks!", 2)
C say("See you later!)
Line C — The closing quote is missing from the string. It should be say("See you later!", 1) with a closing quote and a voice number. Line 2 is wrong.
Question 2
A say("Goodbye!", 2)
B say("See you!", 1)
C say("Hello!", 1)
D say "Hi again!", 1
Line D — say() must be called with parentheses. say "Hi again!", 1 is missing the brackets around the arguments. Line 3 is wrong.
Question 3
A # say() needs two arguments
B say("Bye!", 2)
C say("Hi there!")
Line C — say() requires two arguments: the text and a voice number. The voice number is missing on line 2. Line 2 is wrong.
Question 4
A say("Good morning!", 1)
B say("Good afternoon!", 2)
C say(Good evening!, 1)
Line C — The string argument must be wrapped in quote marks. Good evening! has no quotes around it. Line 2 is wrong.
Question 5
A Say("Hi!", 2)
B # Voice 1 speaks first
C say("Hello!", 1)
Line A — say() must be all lowercase — Say() with a capital S is not recognised as the function. Line 0 is wrong.

Student with a class code? Join your class →