Lesson plan

Python 101 with MakeCode - Lesson 4

Students use Python lists, indexing, and list methods like append and pop to manage animal data, diets, and mob spawning in an animal hospital.

Python 101 with MakeCode - Lesson 4
Ages
Ages 11+
Duration
1 hour
Essential question

How can lists and list methods help us organize, manipulate, and retrieve data effectively in computer programs?

Overview

In this intermediate computer science lesson, students assist the fictional CodingMine software team in developing veterinary software for an animal hospital. Learners explore Python lists as data structures to organize collections of items, understand zero-based indexing, and apply naming conventions using underscores.

Within the Minecraft environment, students bring these programmatic concepts to life by categorizing animals and spawning them into specific enclosures, adjusting dog diets with append and pop to deliver meals, and manipulating lists of cat names using sort and reverse to identify specific pets.

Learning objectives

By the end of this lesson students will be able to:

  • Define a Python list using square brackets and appropriate underscore naming conventions.
  • Apply zero-based numbering to access and update specific elements within a list.
  • Modify list contents using the append and pop methods to handle diverse requirements.
  • Organize list items using the sort and reverse methods to retrieve specific values.
  • Spawn mobs at designated locations using list-driven code.

Blocks and items used in this lesson

Key vocabulary

List
A collection of strings, numerical values, variables, mobs, or items enclosed in square brackets.
Zero-based numbering
A numbering scheme where the first position in an indexed list is designated as zero.
Append
A list method used to add a new element to an existing list.
Pop
A list method used to remove an element from an existing list.
Sort
A list method that arranges items into alphabetical or numerical order.
Reverse
A list method that inverts the current order of elements in a list.

Before class

Lesson sequence

Suggested timing: about 60 minutes in total.

  1. Warm-up and Introduction10 min

    Introduce the lesson scenario: students are aiding CodingMine to build software for an animal hospital. Present the key concepts of lists, square bracket syntax, using underscores in names, and the concept of zero-based numbering using the classroom presentation.

  2. Activity 1: Animal Categorizing15 min

    Guide students to construct a list of animals in Python. Students write code to spawn the different animal mob types into their matching pens at predetermined coordinates.

  3. Activity 2: Dietary Requirements15 min

    Students program a food-making machine that caters to three dogs with unique diets. Students apply the append method to add vitamins for the second dog, use the pop method to remove beef for the third dog, and drop the resulting food into the dog bowls.

  4. Activity 3: What is the Cat's Name?15 min

    Students assist a data scientist by writing code to modify a list of cat names. They update the final name to Shadow, sort the names alphabetically, reverse the list order, and output specific names in chat using positional index values to select the correct cat from the line-up.

  5. Reflect and Review5 min

    Facilitate a short recap asking students to recall list syntax, method functions (reverse, append, sort, pop), and naming rules to reinforce key takeaways.

Assessment: success criteria

  • Student constructs a valid list enclosed in square brackets with underscore naming.
  • Student spawns correct mob types into designated animal pens.
  • Student accurately updates dog food lists using append and pop methods.
  • Student sorts, reverses, and accesses cat names by positional value in chat.

Differentiation

Support

Provide an index reference chart showing zero-based position counts and examples of square bracket syntax.

Stretch

Have students predict the exact chat output of combined sorting and reversing operations before running their code.

Knowledge check

5 questions to check understanding after the lesson. Tap an answer to see if it is right; the score appears at the end.

  1. 1What punctuation marks are placed around the contents of a Python list?

  2. 2What character should be used instead of a space when creating variable or list names?

  3. 3Which method is used to remove an ingredient from the dog food list?

  4. 4What method would you use to organize a list of cat names alphabetically?

  5. 5What numbering system starts counting element positions at index 0?

Resources

Part of the Python 101 curriculum

This is lesson 4 of 10 in Python 101.

  1. Python 101 with MakeCode - Lesson 1
  2. Python 101 with MakeCode - Lesson 2
  3. Python 101 with MakeCode- Lesson 3
  4. Python 101 with MakeCode - Lesson 4
  5. Python 101 with MakeCode - Lesson 5
  6. Python 101 with MakeCode - Lesson 6
  7. Python 101 with MakeCode - Lesson 7
  8. Python 101 with MakeCode - Lesson 8
  9. Python 101 with MakeCode - Lesson 9
  10. Python 101 with MakeCode - Lesson 10

Frequently Asked Questions

What prior experience do students need for this lesson?

This is an intermediate-level Python lesson designed for students aged 11 and up, typically following Lessons 1 through 3 in the Python 101 unit.

What methods are taught in this lesson?

Students learn and apply four distinct list methods: append, pop, sort, and reverse.

Where can the lesson slides be accessed?

The step-by-step classroom presentation is located in the Supporting Files section alongside the Curriculum Overview.

Adapted from Python 101 with MakeCode - Lesson 4 by Minecraft Education on Minecraft Education, last updated Feb 4, 2025. This classroom version, the timings and the quiz were written by 9Minecraft Education.

You May Also Like

9Minecraft Education is an independent teaching resource and is not affiliated with Mojang or Microsoft. Lesson plans here are our own classroom-ready adaptations; each one links to the original resource and credits its author. © 2026 9minecraft.net