Year 9

In a while, crocodile

Year 9

In a while, crocodile

warning

These resources will be removed by end of Summer Term 2025.

Switch to our new teaching resources now - designed by teachers and leading subject experts, and tested in classrooms.

Lesson details

Key learning points

  1. In this lesson, we will investigate iteration using while loops, offering a chance to retrieve and apply relevant knowledge. In the first activities, we will practise using list operations in iterative contexts.

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.
If the user types 1 on the keyboard, what will be the output of this program when it is executed?
An image in a quiz
Correct answer: It’s a rocky planet
The second letter is l
The second letter is, planet
There will be an error message
Q2.
If the user types 3 on the keyboard, what will be the output of this program when it is executed?
It's a rocky planet
Correct answer: The second letter is a
The second letter is l
There will be an error message
Q3.
Suppose that the elif in line 8 is modified to an if. If the user types 1 on the keyboard, what will be the output of this program when it is executed?
It's a rocky planet
Correct answer: It's a rocky planet, The second letter is e
The second letter is e
There will be an error message

3 Questions

Q1.
Read the program below and answer the questions. You can use the reference table at the bottom of the page to see how the index method works. What will be the output of this program?
An image in a quiz
‘c’ + 1
Correct answer: 2
3
d
Q2.
Read the program below carefully. When will the condition in the while loop become False?
An image in a quiz
When the length of the band list is 1
When the length of the band list is 2
Correct answer: When the length of the band list is 3
When the length of the band list is 4
Q3.
Read the program below carefully. When will this while loop terminate?
An image in a quiz
When band is held in the band list
When guitar has been removed from the band list
When guitar is in the band list
Correct answer: When guitar is not in the band list