ProceduralOCR J277
DashboardCoursePracticeReviewProgressGlossary
Saved on this deviceContinue learning

Procedural · OCR J277 programming practice

Progress stays in this browser unless you export it.

Course/Output/Printing text
J277 · 2.2.1

Unit 1 · Lesson 1

Printing text

Lesson progress0 / 7

Build the idea

Start with the concept and its key vocabulary.

Key idea

Use print() with quotation marks to display text.

Programs use output to communicate. In both OCR Exam Reference Language (ERL) and Python, print() displays a message. Put text inside quotation marks so the computer treats it as a string. Python can separate multiple printed values with commas; concatenation uses + to build one string instead.

Output

Data or information a program displays to the user.

String

A sequence of characters, such as a word or sentence.

Syntax

The rules that say how code must be written.

Keep these in mind

  • Text needs matching quotation marks.
  • The output appears without the quotation marks.
  • Python commas separate printed values; + concatenates strings.
  • Capital letters, spaces and punctuation all matter.

Learning objective

Use print() with quotation marks to display text.

Exam tip

When an exam asks for output, copy it exactly. Include all words and spaces, but not the quotation marks from the code.

Common mistake

A comma in Python print() can separate values, but it does not concatenate them. If a task requires one joined string, use +. Missing a quote or closing bracket causes a syntax error.

Next