← IGCSE Computer Science Paper 1

IDE function: code editor

The part of an IDE where you type and edit source code. It shows line numbers and syntax highlighting (colour-coded keywords), which a plain text editor does not.

Understanding IDE function: code editor in IGCSE Computer Science Paper 1

What it does: Line numbers are a code editor feature. They let the programmer go straight to the line a translator reports. Colour-coded keywords are the syntax highlighting that a plain text editor does not give. The code editor is only for typing and editing source code. A compiler or interpreter in the IDE does the translating.

Common mistakes: An if statement must end with a colon. Without it the code has a syntax error. It should be: if has_line_numbers:. The closing bracket is missing from the print call. A code editor can help you spot this, but the fix is: print("Blue:", word).

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 440–449) and word search (Modules 440–463).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Where in an IDE do you type and edit your source code?
The translatorThe code editor
Matches
A code editor is the part of an IDE that translates source code into machine code.
↓
This describes a translator (compiler or interpreter), not the code editor. The code editor is where you type and edit the source code.
Applying
Meanings
Term
code editor
Meaning
The part of an IDE where you type and edit source code. It shows line numbers and syntax highlighting (colour-coded keywords), which a plain text editor does not.
Practice
// Typed in the code editor
Testing
Gaps
("Score:", 10)
Check Answer
Spots
3has_highlighting = True
4if has_line_numbers

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

The 'Thorny Devil' badge — Detail Master, 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. Where in an IDE do you type and edit your source code?
A. The code editor ✓
B. The translator
The code editor is the part of the IDE for typing and editing source code. The translator converts the code into machine code.
2. Which statement about line numbers in a code editor is correct?
A. They are part of the program and are run by the computer
B. They help you find and refer to a line, for example when an error message names line 12 ✓
Line numbers are only a display aid in the editor. They are not part of the source code, but they help you locate errors.
3. What does syntax highlighting do in a code editor?
A. Fixes syntax errors automatically
B. Shows keywords in different colours ✓
Syntax highlighting colour-codes keywords, strings and so on to make code easier to read. Fixing mistakes is auto-correction, a different IDE function.
4. Which of these has syntax highlighting and line numbers as standard?
A. A code editor in an IDE ✓
B. A plain text editor
A plain text editor only stores text. A code editor adds features designed for programmers, such as line numbers and colour-coded keywords.
5. A student types print in blue and a string in red. Which feature is this?
A. Syntax highlighting in the code editor ✓
B. Running the program in the run-time environment
Colour-coding the different parts of the code is syntax highlighting. It happens while you type, before the program is run.

Match the Pairs

code editor → The part of an IDE where the programmer types and edits source code
syntax highlighting → Colour-coding keywords, strings and numbers in the code editor so they are easier to spot
A code editor shows line numbers down the side so you can find the line an error message mentions → 1 name = input("Name: ") 2 print(name)
A code editor uses syntax highlighting, so keywords such as print and if appear in a different colour from the rest of the code → if age >= 16: # 'if' shown in colour
A code editor is the part of an IDE that translates source code into machine code. → This describes a translator (compiler or interpreter), not the code editor. The code editor is where you type and edit the source code.
A plain text editor like Notepad gives line numbers and colour-coded keywords just like a code editor in an IDE. → A plain text editor does not normally give line numbers or syntax highlighting. These features are what make a code editor different.

Key Term

code editor
The part of an IDE where you type and edit source code. It shows line numbers and syntax highlighting (colour-coded keywords), which a plain text editor does not.

Fill in the Blanks

1. # The code editor colours keywords print("Score:", 10) # print is shown in a keyword colour
Hint: Type the function name that displays output on the screen.
2. for i in range(3): print(i)
Hint: Type the keyword that starts a counting loop. A code editor would colour it differently from normal text.
3. score = 60 if score > 50: print("Pass")
Hint: Type the comparison operator meaning 'greater than'.
4. # This comment is shown in a new colour
Hint: Type the symbol that starts a comment in Python. Syntax highlighting usually colours comments.
5. def greet(name): print("Hi", name)
Hint: Type the keyword used to define a function. The editor colours it as a keyword.

Spot the Error

Question 1
A name = "code editor"
B has_line_numbers = True
C has_highlighting = True
D if has_line_numbers
E print("Editor: " + name)
Line D — An if statement must end with a colon. Without it the code has a syntax error. It should be: if has_line_numbers:
Question 2
A keywords = ["if", "for", "while"]
B for word in keywords:
C print("Blue:", word
Line C — The closing bracket is missing from the print call. A code editor can help you spot this, but the fix is: print("Blue:", word)
Question 3
A define show_line(num, text):
B print(num, text)
C show_line(1, "print('Hi')")
Line A — Python uses the keyword def, not define. A code editor with syntax highlighting would not colour define as a keyword, which is a clue that it is wrong.
Question 4
A lines = 3
B count = 0
C while count < lines:
D count + 1 = count
E print("Line", count)
Line D — The variable being assigned to must be on the left of the = sign. It should be: count = count + 1
Question 5
A editor_type = "code editor
B if editor_type == "code editor":
C print("Line numbers shown")
Line A — The string is missing its closing quote. A code editor with syntax highlighting would colour the rest of the line as text, showing the mistake. It should end with ".

Student with a class code? Join your class →