Programming Fundamentals & Data Types (1)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:20 AM on 4/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

What is a variable?

A named memory location that holds data that can change during the execution of a program.

2
New cards

Define constant.

Fixed data that during the execution of a program cannot change.

3
New cards

What is assignment?

The process of storing data in a variable or constant under a descriptive name. Example: name = "SME"

4
New cards

What is an operator?

A symbol used to instruct a computer to perform a specific operation on one or more values (e.g. arithmetic, comparison).

5
New cards

State four arithmetic operators.

+, -, *, /, %, //, **, MOD, DIV, ^ (any four)

6
New cards

State two comparison operators.

==, !=,

7
New cards

Define input.

A value that is read from an input device and then processed by a computer program.

8
New cards

True or False? Without inputs, programs are useful.

False. Without inputs, programs are not useful as they can't interact with the outside world and always produce the same result.

9
New cards

What is an output?

A value sent to an output device from a computer program.

10
New cards

Typical output devices include?

Monitor, speaker, printer.

11
New cards

What is a programming construct?

A construct that determines the order in which lines of code are executed and controls the logic and behaviour of code.

12
New cards

The three core programming constructs are?

Sequence, selection, and iteration.

13
New cards

Define sequence.

Lines of code which are run one line at a time in the order they are written from first to last.

14
New cards

What is selection?

When the flow of a program is changed depending on a set of conditions, determining which lines or block of code runs next.

15
New cards

Two ways to write selection statements are?

If…then…else statements and case/switch statements.

16
New cards

Define iteration.

Repeating a line or block of code using a loop.

17
New cards

State two types of iteration.

Count controlled (e.g. for loop) and condition controlled (e.g. while loop).

18
New cards

The keywords indicating selection are?

If, elseif, else, endif, switch, case.

19
New cards

The keywords indicating iteration are?

For, while, do.

20
New cards

If no selection or iteration keywords are present, the construct is?

Sequence.

21
New cards

State the output of 10 MOD(%) 3?

1

22
New cards

State the output of 10 DIV 3?

3

23
New cards

State the output of 2 ^ 3?

8

24
New cards

State the output of 15 % 4?

3

25
New cards

State the output of 10 // 2?

5

26
New cards

True or False? A data type classifies data into groups according to the kind of data they represent.

True.

27
New cards

What is a data type?

A classification of data into groups according to the kind of data they represent.

28
New cards

What is an integer?

A data type used for whole numbers like 10, -5, 0.

29
New cards

What is a real?

A data type used for numbers with a fractional part like 3.14, -2.5, 0.0.

30
New cards

What is a character?

A data type used for single characters like 'a', 'B', '6', '£'.

31
New cards

What is a string?

A data type used for a sequence of characters like "Hello world", "ABC", "@

32
New cards

What is a Boolean?

A data type used for true or false values like True, False.

33
New cards

What is casting?

Converting one data type to another data type.

34
New cards

True or False? Casting changes the data type within a program.

True.

35
New cards

State the Python code to cast an integer to a real. Variable is X.

real_value = float(X)

36
New cards

State the Python code to cast a real to an integer. Variable is X.

int_value = int(X)

37
New cards

State the Python code to cast a Boolean to a string. Variable is X.

str_value = str(X)