←

Programming concepts used in AI

From Mock A · Paper 1: Written examination
31 mark
Which programming construct repeats a block of code?
From Mock A · Paper 1: Written examination
12(a)1 mark
A program is used to find the highest score in a list.
1  scores = [12, 45, 7, 30]2  highest = scores[0]3  for s in scores:4      if s > highest:5          highest = s6  print(highest)
Identify one variable used in the program.
From Mock A · Paper 1: Written examination
12(e)3 marks
Rewrite the program in 12(a) as a function called `find_highest` that takes a list of numbers as a parameter and returns the highest value.
From Mock B · Paper 1: Written examination
31 mark
What is printed by this code?
x = 7y = 3print(x % y)
From Mock B · Paper 1: Written examination
12(b)1 mark
State the data type of the variable `attempts` in 12(a).
From Mock B · Paper 1: Written examination
12(f)3 marks
Modify the program so that, after each wrong password, it outputs how many attempts are left. Write your answer in Python or pseudocode.
From Mock C · Paper 1: Written examination
41 mark
Which statement best describes a function in programming?
From Mock C · Paper 1: Written examination
14(b)1 mark
Identify the parameter of the function `classify_temp`.
From Mock C · Paper 1: Written examination
14(c)2 marks
Explain one benefit of using a function in this program.
From Mock C · Paper 1: Written examination
14(e)3 marks
Write a function `is_freezing(t)` that returns `True` if the temperature is 0 or below and `False` otherwise.
From Mock D · Paper 1: Written examination
31 mark
Which data type is most suitable for storing whether a light is on or off?
From Mock D · Paper 1: Written examination
13(c)3 marks
Extend the program in 13(a) so that it also counts and outputs how many temperatures are above 20.
From Mock E · Paper 1: Written examination
31 mark
What is printed by this code?
for i in range(3):    print(i)
From Mock E · Paper 1: Written examination
16(b)2 marks
The program uses lists. Explain why lists are used rather than a separate variable for each score.
From Mock E · Paper 1: Written examination
16(c)3 marks
Modify the program so that it also counts the number of students who passed and outputs this total at the end.
From Mock F · Paper 1: Written examination
31 mark
What is a variable?
From Mock F · Paper 1: Written examination
15(b)2 marks
Explain the purpose of `.lower()` in the program in 15(a).
From Mock F · Paper 1: Written examination
15(c)3 marks
Write a program that asks the user to enter a word and uses `count_vowels` to output "Lots of vowels" if the word has more than 3 vowels, and "Few vowels" otherwise.
Score 0 / 33 · 0 of 18 marked

This paper is written by Plasmo in the style of the LRN GCSE Artificial Intelligence exam. It is not a past paper and is not produced or endorsed by the exam board.

Programming concepts used in AI Exam Questions: LRN GCSE Artificial Intelligence | Plasmo