Skip to content

Commit 0fdf259

Browse files
authored
Update WEEK_28.md
Added bullets
1 parent e6d950a commit 0fdf259

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/newsletters/2023/WEEK_28.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ To dive deeper into the `string` module and its functionalities, here are some r
380380
- Official Python Documentation: [`string`](https://docs.python.org/3/library/string.html)
381381

382382

383-
### 🔢 Python Match Statement
383+
### 6. 🔢 Python Match Statement
384384

385385
Introduced in Python 3.10, the match statement is a powerful tool for pattern matching. It allows you to simplify complex if-elif-else chains by providing a concise and readable syntax. Here's an example:
386386

@@ -407,7 +407,7 @@ def get_day_of_week(day_number):
407407

408408
The match statement evaluates the input expression (`day_number` in this case) and compares it against different patterns (`case` statements). If a match is found, the corresponding block of code is executed. The `_` represents a wildcard pattern that matches anything.
409409

410-
### 🌪️ Decorators that Take Arguments
410+
### 7. 🌪️ Decorators that Take Arguments
411411

412412
Building upon the [previous article](https://python-world.github.io/newsletter/newsletters/2023/WEEK_27.html#unleash-the-power-of-python-function-decorators) on decorators, we can enhance their functionality by allowing them to accept arguments. This provides greater flexibility and customization.
413413

@@ -432,7 +432,7 @@ greet("John")
432432

433433
In this example, the `repeat` decorator takes an argument `n` and returns a decorator function. This decorator function, in turn, takes the original function as an argument and returns the modified function (`wrapper`). The modified function is then executed multiple times, as specified by the `repeat` argument.
434434

435-
### 🛫 Map and Filter Functions
435+
### 8. 🛫 Map and Filter Functions
436436

437437
Python provides two built-in functions, `map` and `filter`, that are widely used to process iterables.
438438

@@ -454,7 +454,7 @@ even_numbers = filter(lambda x: x % 2 == 0, numbers)
454454
print(list(even_numbers)) # Output: [2, 4]
455455
```
456456

457-
### 🍁 Global and Nonlocal Variables
457+
### 9. 🍁 Global and Nonlocal Variables
458458

459459
In Python, the `global` and `nonlocal` keywords allow you to modify variables outside the current scope.
460460

@@ -487,7 +487,7 @@ def outer():
487487
outer() # Output: 2
488488
```
489489

490-
### 🫙 Closures
490+
### 10. 🫙 Closures
491491

492492
A closure is a function object that remembers values in its enclosing scope, even if they are not present in memory. This allows the function to access and manipulate variables from the outer function, even after the outer function has finished executing. Here's an example:
493493

0 commit comments

Comments
 (0)