Lesson details

Key learning points

  1. In this lesson, we will identify the operations that are commonly performed on lists: adding, removing, or modifying items; locating or counting occurrences of particular items, etc.

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 is the name of this data structure?
Comma separated values
Correct answer: List
String
Variable
Q2.
If the lines below were added to the program in question 1 (above), what would the program output be?
Friday
item
Correct answer: Thursday
Wednesday
Q3.
If the lines below were added to the program in question 1 (above), what would the program output be?
Correct answer: 1 Wednesday
index, item
index, Wednesday
Wednesday

3 Questions

Q1.
If the user types 1 on the keyboard, what will be the output of this program when it is executed?
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

Lesson appears in

UnitComputing / Python programming with sequences of data

Computing