This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of using callbacks with Python | |
# | |
# To run this code | |
# 1. Copy the content into a file called `callback.py` | |
# 2. Open Terminal and type: `python /path/to/callback.py` | |
# 3. Enter | |
def add(numbers, callback): | |
results = [] | |
for i in numbers: |