Skip to main content

Lists

Storing Multiple Values in Python

· 3 min read

In the previous unit, we explored string operations. Now let's look at lists, Python's way of storing multiple values in a single variable.

Lists

Built-in Functions

Tools That Come with Python

· 3 min read

In the previous unit, we made our Turtle programs interactive with keyboard and mouse events. Now let's explore Python's built-in functions, tools that are always available without importing anything.

Built-in Functions

Turtle Events

Making Graphics Interactive

· 2 min read

In the previous unit, we covered lambda functions. Now let's make our Turtle programs interactive. Events let your program respond to user input like key presses and mouse clicks.

Turtle Events

Lambda Functions

Anonymous Functions in Python

· 2 min read

In the previous unit, we defined functions with def. Python has another way to create functions: the lambda keyword. Lambda functions are small, anonymous functions that you can define in a single line.

Lambda Functions

Functions

Reusable Blocks of Code

· 3 min read

In the previous unit, we used loops to repeat code. But what if you want to reuse the same block of code in different places? That's what functions are for. They let you define a block of code once and call it whenever you need it.

Functions

Match-Case Statements

Pattern Matching in Python

· 3 min read

In the previous unit, we used if, elif, and else to make decisions. Python 3.10 introduced a cleaner alternative for certain situations: the match-case statement. It's particularly useful when you're comparing one value against several possibilities.

Match-Case Statements