Computer science revision for Tuesday 31st Nov 2026

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

1/89

flashcard set

Earn XP

Description and Tags

Study guide for computer science

90 Terms

1
New cards

What is programming?

Sequencing instructions in the correct order.

2
New cards

Why is the order of instructions important?

The sequence order matters, and accuracy is important.

3
New cards

What is Python?

A programming language that is simple to learn.

4
New cards

Name some applications or organisations that use Python.

NASA, Paint Shop Pro, Google Search, Civilization 4, CERN and Dropbox.

5
New cards

What does IDE stand for?

Integrated Development Environment.

6
New cards

What are the two screens in the online IDE described in the lesson?

Shell and Terminal.

7
New cards

What is the Shell used for?

Typing your code.

8
New cards

What is the Terminal used for?

Displaying your program's outputs.

9
New cards

What is the purpose of a Hello World program?

It displays text on the screen; it is a programming tradition.

10
New cards

Which Python function displays text?

print()

11
New cards

Which Python function accepts user input?

input()

12
New cards

What is a syntax error?

An error in the code's syntax that prevents it being written or understood correctly.

13
New cards

What does a NameError message indicate?

A name used in the code has not been defined, such as a misspelt function name.

14
New cards

What is debugging?

Finding and fixing errors in a program.

15
New cards

What is a computer bug?

An error in a program.

16
New cards

What is a variable?

A location in memory used to temporarily store text or numbers.

17
New cards

What is a variable name?

The name chosen for a variable, like the name of a box storing a value.

18
New cards

What characters can a Python variable name contain?

Numbers, letters and underscores.

19
New cards

Can a Python variable name start with a number?

No.

20
New cards

Can a Python reserved word be used as a variable name?

No; for example, class is a reserved word.

21
New cards

Why should variable names be meaningful?

They make programs easier to understand.

22
New cards

What is a comment used for?

To document a program and make code easier to understand.

23
New cards

What symbol starts a Python comment?

#

24
New cards

Do comments affect how a program runs?

No.

25
New cards

What is a Python function?

A special built-in routine that performs a specific job.

26
New cards

Give two examples of Python functions from the lesson.

print() and input().

27
New cards

What is a string?

A data type that holds alphanumeric data as text.

28
New cards

What is an integer?

A data type that holds whole numbers.

29
New cards

What is a float?

A data type that holds numbers with a decimal point.

30
New cards

What is a Boolean?

A data type that holds either True or False.

31
New cards

What data type does input() return?

A string.

32
New cards

What is casting?

Manually defining or changing a variable's data type.

33
New cards

Which function converts a value to a string?

str()

34
New cards

Which function converts a value to an integer?

int()

35
New cards

Which function converts a value to a float?

float()

36
New cards

What does round() do?

Rounds a number, optionally to a chosen number of decimal places.

37
New cards

What does round(228.374, 2) return?

228.37

38
New cards

What is an assignment statement?

A statement that assigns a value to a variable.

39
New cards

What happens if an assignment uses a variable that does not already exist?

The variable is created.

40
New cards

What does BIDMAS stand for?

Brackets, Indices, Division and Multiplication, Addition and Subtraction.

41
New cards

Why does the order of arithmetic operations matter in programming?

The order affects the calculation's result; BIDMAS applies.

42
New cards

Which Python operator is used for addition?

+

43
New cards

Which Python operator is used for subtraction?

-

44
New cards

Which Python operator is used for multiplication?

*

45
New cards

Which Python operator is used for division?

/

46
New cards

Which Python operator is used for floor division?

//

47
New cards

Which Python operator gives the remainder?

%

48
New cards

What is the result of 7 // 2?

3

49
New cards

What is the result of 7 % 3?

1

50
New cards

What are the three stages of a program involving input, calculation and output?

Accept input, perform a calculation, then display output.

51
New cards

What is selection in programming?

Using a condition to make a decision about which code runs.

52
New cards

What does an if statement do?

Checks a condition and runs a block of code if it is true.

53
New cards

What does else do in an if statement?

Runs the alternative block when the if condition is false.

54
New cards

What does elif mean?

Else if; it checks another condition and allows more than two options.

55
New cards

How many times can elif be used in a selection structure?

As many times as needed.

56
New cards

What does the comparison operator == mean?

Equal to.

57
New cards

What does the comparison operator != mean?

Not equal to.

58
New cards

What does the comparison operator > mean?

Greater than.

59
New cards

What does the comparison operator < mean?

Less than.

60
New cards

What does the comparison operator >= mean?

Greater than or equal to.

61
New cards

What does the comparison operator <= mean?

Less than or equal to.

62
New cards

What is indentation used for in Python?

It marks the start and end of a block of code.

63
New cards

Why is correct indentation important?

Incorrect indentation can stop a program running or make it give the wrong result.

64
New cards

What is pseudocode?

A mixture of code and English used to plan an algorithm.

65
New cards

Does pseudocode have real programming syntax?

No; it would not run as program code.

66
New cards

Why is pseudocode useful?

It helps plan algorithms without needing the exact syntax of a programming language.

67
New cards

What should be used in pseudocode to show code blocks?

Indentation.

68
New cards

Name some common pseudocode instructions.

input, print, display output, calculate, add, set, if, then, else and endif.

69
New cards

What is an algorithm?

A planned sequence of steps to solve a problem or complete a task.

70
New cards

Name the three types of programming error in the lesson.

Syntax errors, run-time errors and logic errors.

71
New cards

What is a while loop used for?

Repeating code while a condition is true.

72
New cards

What happens when a while loop's condition is false?

The loop stops and the program continues after it.

73
New cards

What happens when a while loop's condition is true?

The conditional code inside the loop runs.

74
New cards

What is a counter variable used for in a loop?

To keep track of how many times something happens.

75
New cards

How can a counter be increased by one in Python?

counter = counter + 1

76
New cards

What is a running total used for?

To keep adding values together as they are entered.

77
New cards

How can an if statement be used inside a while loop?

To make a decision during each repetition of the loop.

78
New cards

What is the random module used for?

Generating random numbers.

79
New cards

What Python statement imports the random module?

import random

80
New cards

How do you generate a random integer from 1 to 6 in Python?

random.randint(1,6)

81
New cards

What is a linear search?

A search that examines each item in a list one at a time, from the beginning.

82
New cards

Does a list need to be sorted for a linear search?

No.

83
New cards

What is a binary search?

A search that repeatedly halves the range of an ordered list.

84
New cards

Does binary search require the data to be ordered?

Yes; it is used on a sorted or ordered list.

85
New cards

What is the first step in a binary search?

Find the midpoint of the range.

86
New cards

In binary search, what happens if the target is lower than the midpoint?

Discard the upper half and search the lower half.

87
New cards

In binary search, what happens if the target is higher than the midpoint?

Discard the lower half and search the upper half.

88
New cards

Why can binary search be more efficient than linear search?

It halves the search range each time instead of checking items one by one.

89
New cards

Give examples of places where binary search may be used.

Searching ordered registration numbers, supermarket product details, hospital records or insurance policies.

90
New cards

What is the maximum number of guesses for a binary search over 1–100, according to the lesson?

7 guesses.