Year 11
Lesson details
Key learning points
- In this lesson, we will use what we have learnt about 2D lists in previous lessons to complete a challenging project.
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
3 Questions
Q1.
What will the output be when this program is executed?
Fred
Fred, Wilma, Dino, 4, 5, 6
scores[0]
Q2.
If the user enters Bob when prompted, what will be the output?
{answer}'s score is {score}
5
Error: index out of range
Q3.
Is this a definition for a 2D array or a 2D list? A __________ must be a predefined fixed size and each item held must be of the same data type.
2D list
3 Questions
Q1.
Work out all of the possible ways that you can win at noughts and crosses. Write the total number below:
10
15
4
Q2.
True or False: A function always returns a value.
False
Q3.
A 2D list is created for a noughts and crosses board. What code will be needed to assign a value to location 5?
[1][5]
[2][2]
[2][5]