Data Types: Programming fundamentals: Computer Science: GCSE (9:1)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

Data type

The kind of data a variable contains, it can be character, string, integer, real or boolean

2
New cards

Character

The data type of a single character e.g. "A" or "$"

3
New cards

String

This data type stores a series of characters, e.g. "Zak", "MK44 5AB" or "123456789"

4
New cards

Integer

The data type of a whole number e.g. 5, 999 or -4

5
New cards

Boolean

This data type has only two values, TRUE and FALSE

6
New cards

Real

A data type for real numbers, also called floating point numbers or floats, they have a decimal part, for example 1.5, 0.935 or the value of Pi

7
New cards

Casting

Changing the data type using a function such as int() or str()

8
New cards

int("12")

This expression uses a casting function to change a string to an integer and results in the integer value 12

9
New cards

str(12.8)

This expression uses a casting function to change a float to a string and results in the string value "12.8"

10
New cards

float("12.8")

This expression uses a casting function to change a string to a float and results in the real value 12.8

11
New cards

input()

A function that inputs a value from the keyboard. In Python this always returns a string so we must cast this to integer or float if we need it to be numeric

12
New cards

int(input())

Returns the integer value of some input from the keyboard (in both Exam Reference Language and Python)

13
New cards

Comparison

This type of operation always returns a boolean value, because it answers a question such as age > 18 or answer == "Yes"

14
New cards

Arithmetic

This type of operation returns either integer or float values because it performs a numeric calculation such as fare * 2.5 or sum(temps)

15
New cards

Logic

This type of operation always returns a boolean value (True or False) because it performs boolean operations on other boolean expressions