Lesson 6
Dealing with Sequences of Objects
Chapter 11: Summary
Summary
And that is it for this lesson. Hope you enjoyed all the quizzes! 😈
Let us do a quick recap of our lesson. Are you able to answer the following questions?
- Do you know what a Python list is and for what can it be used?
- Are you able to initialise a list?
- Are you able to access an element in a list via list indexing?
- Do you understand the behaviour of negative indices in Python?
- Are you comfortable with list slicing?
- Are you comfortable with list slicing with a third step parameter?
- How do you reverse a list with list slicing?
- Are you able to understand nested lists (i.e. lists inside lists), and how elements of such lists can be accessed?
- Do you know how to modify an element in a list via list indexing and/or slicing?
- Do you know how to append an element to an existing list?
- Can you delete an element from a list?
- What operators can be used for lists?
- Are you comfortable with list membership operators (
in
,not in
)? - What are
for
loops? - What does the
continue
statement do? How is it different frombreak
andpass
? - What is the
range()
object do? How is it used withfor
loops? - Are you comfortable with nested
for
loops? - Do you (generally) know when it might be better to use a
for
loop and when it might be better to usewhile
loops? Sometimes both types of loops are acceptable, and you can always convert afor
loop into awhile
loop. - What is a tuple, and how is it different from a list?
- Do you know how to initialise tuples and access the elements in a tuples?
- Can you modify elements in a tuple?
- Are you aware that Python strings can be treated as sequences?
- Can you access elements in a string?
- Are strings mutable or immutable?
- Do you understand the concept of Test Driven Development (TDD)? And why you need to write multiple test codes for automated code testing?
- Are you able to use breakpoints to debug code with the Python debugger?
You have also extended your robot project to generate multiple robots (each with a random name and unique ID assigned)! You have also abstracted row
and columns
into a single position
tuple.
You have also looked at how you can use git checkout
to examine previous version of files in your old git commits.
Speaking of which, here is the commit for my example implementation of the robot project to date.
Looks like we have covered quite a lot! In our next lesson, I will continue giving you more tools to make your programming life more efficient!
As usual, take a break, and I will see you in the next lesson!