Variable: GCSE Computer Science Definition
Written by: James Woodhouse
Published
Read time
1 minutes
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.
Sign up for articles sent directly to your inbox
Receive news, articles and guides directly from our team of experts.
Share this article