Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Paper 2/Additional Programming Techniques

Concatenation

The use of basic string manipulation: Concatenation

2.2.3 Additional Programming Techniques

Practise exam questions

Additional Programming Techniques — Note 1 of 12

use of + between strings to join them together

What you need to know

String concatenation is the process of joining two or more strings together using the + operator. This is commonly used to combine text with variable values for output. When concatenating, all values must be strings; numbers need to be cast to strings first using str().

What to know

  • Example: "Hello" + " " + "World" produces "Hello World".
  • All values being concatenated must be strings; use str() to convert numbers first.
  • Useful for building output messages that include variable values.
  • In OCR pseudocode: print("Name: " + name). Use + for concatenation, NOT commas.

Key terms

Concatenation

Joining two or more strings together using the + operator.

Exam technique

  • Mistake:Using a comma instead of + for concatenation. In Python, commas in print() just separate items — they don't join strings.
  • Tip:word1 = "Hello", word2 = "Everyone", message = word1 + word2 → "HelloEveryone". Store the result in the specified variable — don't just print it.
  • Example:sensorID = sensorType + sensorNumber concatenates two strings into one (line 04 is the concatenation line).

Code examples

String concatenation
python
first = "Hello"
second = "World"
greeting = first + " " + second
print(greeting)  # Output: Hello World

age = 16
print("Age: " + str(age))  # Must cast int to str

Ready to test yourself?

Practise 2.2.3 questions
← Previous topicCasting2.2.2 Data TypesNext note →slicing2.2.3 Additional Programming Techniques

Back to Additional Programming Techniques

Revise another OCR GCSE topic: Programming Fundamentals

Additional Programming Techniques

Note 1 of 12

  1. 1Concatenation
  2. 2slicing
  3. 3Open, Read, Write, Close
  4. 4Records to store data
  5. 5SQL to search for data
  6. 6one-dimensional (1D)
  7. 7two-dimensional arrays(2D)
  8. 8Sub programs (functions and procedures) to produce structured code
  9. 9local variables
  10. 10global variables
  11. 11arrays
  12. 12Random number generation
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).