1.4.1

Variables & Constants

Test yourself on Variables & Constants

Test your knowledge with free interactive questions on Seneca — used by over 10 million students.

Variables and Constants

Variables and constants allow us to store results in the main store.

Variables

Variables

  • Variables are named spaces in the memory where data can be stored.
  • The value of a variable is the data stored inside it.
  • The value can change whilst the program is running.
Constants

Constants

  • Constants are similar to variables, but the value cannot change whilst the program is running.
  • Constants make the code easier to read.
Assignment

Assignment

  • To use a variable, we give it a name and a value. For example:
    • x = 50
  • We can then use this variable in other expressions by using its identifier (name).
Jump to other topics
1

Introduction to Python

2

Data Structures

2.1

Lists & Strings

2.2

File Handling

3

Modularity

3.1

Subroutines

3.2

Data Flow

4

Good Practice

4.1

Naming & Whitespace

4.2

Comments

4.3

Exceptions

Practice questions on Variables & Constants

Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.

  1. 1
  2. 2
  3. 3
Answer all questions on Variables & Constants

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium