Guide Python Beginner

Lists: Chapter Practice

Apply lists with a mini lab and knowledge check.

1 min read

Mini lab

Filter unhealthy server names into a new list.

Expected output: [‘web-01’, ‘web-02’]

HintUse the chapter examples to choose the operation, then run your version before opening the solution.
Show solution
names = ["web-01", "db-01", "web-02"]
print([name for name in names if name.startswith("web-")])

Knowledge check

What does list.append() return?

Check your answerNone; it mutates the existing list.

Finish the chapter

  • Explain each operation without reading the lesson.
  • Change the sample input and predict the output before running it.
  • Revisit the chapter if the result differs from your prediction.

Back to this chapter · Choose the next chapter

Add More Questions to This Guide

Know a question that should be here? Share it and help the community!

Open Google Form