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.
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

Share this article