Variable - GCSE Computer Science Definition

Reviewed by: James Woodhouse

Last updated

What is a variable?

In GCSE Computer Science, a variable is a named memory location that holds data that can change during the execution of a program. Variables can store a variety of different types of data such as integers, strings or boolean values. 

To store data in a variable, the process of assignment is used. A variable will have an identifier (name) and will then be assigned a value. Some programming languages will also declare the data type of the variable. Some examples of declaring a variable and assigning it a string value of “Save My Exams” have been included below in various languages:

Language

Code

Python

name = "Save My Exams"

Visual Basic

Dim name As String

name = "Save My Exams"

Java

String name = "Save My Exams";

Pseudocode

name ← "Save My Exams"

Variable Revision Resources to Ace Your Exams

Explore variables in more detail and master other key-related terms such as assignment & data types. Challenge yourself with our expertly created topic questions and reinforce your learning with our interactive flashcards


GCSE Computer Science Revision Resources

Examiner-written GCSE Computer Science revision resources that improve your grades 2x

  • Written by expert teachers and examiners
  • Aligned to exam specifications
  • Everything you need to know, and nothing you don’t
GCSE Computer Science revision resources

Share this article

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.

The examiner written revision resources that improve your grades 2x.

Join now