Outputting several values with commas
One OUTPUT command can display several values, separated by commas. Mix text in quotes with variables. Any spaces you want shown must be inside the quotes.
Understanding Outputting several values with commas in IGCSE Computer Science Paper 2
What it does: The space after the colon is inside the quotes, so it appears between Name: and the value of the variable. Text, a variable and more text are separated by commas, so all three parts are displayed by one command. Commas separate each value in one OUTPUT command. Without commas, the command is not valid. "Lives" in quotes is just text, so it would show the word Lives. Without quotes it shows the value 2.
Common mistakes: The values in an OUTPUT command must be separated by commas. A comma is missing between "Level " and 1. It should be OUTPUT "Level ", 1. Quotes around Lives make it text, so the word Lives is displayed instead of its value. A variable must be written without quotes: OUTPUT "You have ", Lives.
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 327–336) and word search (Modules 317–336).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
OUTPUT "You have ", Lives, " lives left"Fill in the Blanks
Spot the Error
Student with a class code? Join your class →