Lesson details

Key learning points

  1. In this lesson, we will explore some common list methods through the creation of a program that populates a deck of cards. We will also learn how lists can be returned from a function.

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...

4 Questions

Q1.
What will be the output of print, when this program is executed?
An image in a quiz
house, mountain
mountain
Correct answer: sheep
u
Q2.
Is an array static or dynamic?
Dynamic
Correct answer: Static
Q3.
Is a list static or dynamic?
Correct answer: Dynamic
Static
Q4.
What will be the output of print, when this program is executed?
An image in a quiz
Days
Correct answer: IndexError
Monday
Sunday

3 Questions

Q1.
What method should you use to add something to the end of a list?
add()
Correct answer: append()
insert()
plus()
Q2.
What method should you use to sort a list in ascending order?
ascending()
atoz()
Correct answer: sort()
sort(ascending)
Q3.
True or False: You can return a list from a function
False
Correct answer: True