2D Lists challenge
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?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707157306%2Fw9y4gbshwjxi22irt2t9.png&w=1200&q=75)
Fred
Fred, Wilma, Dino, 4, 5, 6
scores[0]
Q2.
If the user enters Bob when prompted, what will be the output?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707157298%2Ffrjb95dyqu2smhrrmics.png&w=1080&q=75)
{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?
![An image in a quiz](/_next/image?url=https%3A%2F%2Foaknationalacademy-res.cloudinary.com%2Fimage%2Fupload%2Fv1707152129%2Fmxzz1yfbalcyddr3q4s1.png&w=384&q=75)
[1][5]
[2][2]
[2][5]