Python 2d Lists: A Project-based Approach

Python 2d Lists: A Project-based Approach

1h 23mIntermediate2020-03-04

Authors

Robin Andrews

Robin Andrews

Founder of Compucademy

Course details

2D lists are an essential data structure in programming. In this practical course, learn how to create and work with 2D lists in Python as you build a full-fledged memory game. Instructor Robin Andrews begins with the basics, explaining what 2D lists are and how to put them to work in Python. Robin quickly moves from the theoretical to the practical, delving into the specifics of creating a simple memory game based on card matching. He explains how to import modules, write functions that support the operations of your game, and validate user input. Plus, he shares strategies for refining your project. Upon wrapping up this course, you'll have a working game that serves as a testament to your enhanced understanding of 2D lists in Python.

Skills covered

PythonLearningProgramming LanguagesOpen SourceSoftware Development

Concepts

Introduction

  • 2D lists in Python
  • Memory game - Demonstration
  • Your Python setup

Review of 1D Lists in Python

  • Python 1D lists review

2D Lists in Python

  • Python 2D lists - Introduction
  • Iterating through 2D lists in Python
  • Creating and working with 2D lists in Python
  • Challenge - Dice sums exercise
  • Solution - Dice sums exercise

Game Outline

  • Imports and constants
  • Function stubs - The 'skeleton' of your program

Game Functions

  • Supporting functions in Python
  • Additional helper functions in Python
  • create_board()
  • Displaying elements of a 2D list in Python
  • Working with a 2D list in Python, part 1
  • Working with a 2D list in Python, part 2
  • Getting user input in Python
  • Validating user input in Python, part 1
  • Validating user input in Python, part 2
  • main() function final game logic

Refining the Game

  • Refinements, part 1
  • Refinements, part 2
  • Review, comments, and next steps
40,000 Toman