fix(curriculum): removed decorators section from python review (#64800)

This commit is contained in:
Zeina Obeid
2025-12-22 12:09:51 +02:00
committed by GitHub
parent 1459c85678
commit 8190dd2cec
2 changed files with 0 additions and 42 deletions

View File

@@ -626,27 +626,6 @@ print(int(True)) # 1
print(int(False)) # 0
```
## Decorators
- **Definition**: Decorators are a special kind of function in Python. They are like wrappers for other functions, so they take another function as an argument.
```py
def say_hello():
name = input('What is your name? ')
return 'Hello ' + name
def uppercase_decorator(func):
def wrapper():
original_func = func()
modified_func = original_func.upper()
return modified_func
return wrapper
say_hello_res = uppercase_decorator(say_hello)
print(say_hello_res())
```
## Scope in Python
- **Local Scope**: This is when a variable declared inside a function or class can only be accessed within that function or class.

View File

@@ -626,27 +626,6 @@ print(int(True)) # 1
print(int(False)) # 0
```
## Decorators
- **Definition**: Decorators are a special kind of function in Python. They are like wrappers for other functions, so they take another function as an argument.
```py
def say_hello():
name = input('What is your name? ')
return 'Hello ' + name
def uppercase_decorator(func):
def wrapper():
original_func = func()
modified_func = original_func.upper()
return modified_func
return wrapper
say_hello_res = uppercase_decorator(say_hello)
print(say_hello_res())
```
## Scope in Python
- **Local Scope**: This is when a variable declared inside a function or class can only be accessed within that function or class.