Computer Science GCES EDEXCEL
-
Decomposition And Abstraction Edexcel2 主题
-
Algorithms Edexcel11 主题
-
Follow And Write Algorithms Edexcel
-
Introduction To Programming Concepts Edexcel
-
Basic Programming Concepts Edexcel
-
Variables Constants And Assignments Edexcel
-
Data Structures And Arrays Edexcel
-
Arithmetic Relational And Logical Operations Edexcel
-
Determine Outputs Of An Algorithm Edexcel
-
Types Of Errors Edexcel
-
Standard Sorting Algorithms Edexcel
-
Standard Searching Algorithms Edexcel
-
Algorithm Efficiency Edexcel
-
Follow And Write Algorithms Edexcel
-
Truth Tables Edexcel3 主题
-
Binary Edexcel6 主题
-
Data Representation Edexcel4 主题
-
Data Storage And Compression Edexcel2 主题
-
Hardware Edexcel5 主题
-
Software Edexcel3 主题
-
Programming Languages Edexcel2 主题
-
Networks Edexcel7 主题
-
Network Security Edexcel2 主题
-
Environmental Issues Edexcel1 主题
-
Ethical And Legal Issues Edexcel3 主题
-
Cybersecurity Edexcel2 主题
-
Develop Code Edexcel6 主题
-
Constructs Edexcel4 主题
-
Data Types And Data Structures Edexcel5 主题
-
Operators Edexcel1 主题
-
Subprograms Edexcel2 主题
Variables Constants And Assignments Edexcel
Exam code:1CP2
Variables, Constants & Assignments
What is a variable?
-
A variable is a named memory location that holds data that during the execution of a program, the data can change
-
Variables can store a variety of different types of data such as numbers, text or true/false values
-
To store data in a variable, the process of assignment is used
What is a constant?
-
A constant is fixed data that during the execution of a program cannot change
-
A constant can store a variety of different types of data, similar to variables
-
Pi is an example of a mathematical fixed value that would typically be stored as a constant
What is assignment?
-
Assignment is the process of storing data in a variable or constant under a descriptive name
-
Assignment is performed using the ‘=‘ symbol
Assigning variables & constants
|
Concept |
Python |
|---|---|
|
Variables |
|
|
Constants |
|
Data Types
What is a data type?
-
A data type is a classification of data into groups according to the kind of data they represent
-
Computers use different data types to represent different types of data in a program
-
The basic data types include:
|
Data type |
Used for |
Example |
|---|---|---|
|
Integer |
Whole numbers |
10, -5, 0 |
|
Real |
Numbers with a fractional part |
3.14, -2.5, 0.0 |
|
Character |
Single character |
‘a’, ‘B’, ‘6’, ‘£’ |
|
String |
Sequence of characters |
“Hello world”, “ABC”, “@#!%” |
|
Boolean |
True or false values |
True, False |
-
It is important to choose the correct data type for a given situation to ensure accuracy and efficiency in the program
-
Data types can be changed within a program, this is called casting
Responses