Just added: Algorithms you can run and practice
Python
# The weekly order report. It runs clean and prints a number - the wrong one. Fix it.
orders = [
    {"id": "A-1001", "amount": 40},
    {"id": "A-1002", "amount": 120},
    {"id": "A-1003"},
    {"id": "A-1004", "amount": 65},
    {"id": "A-1005", "amount": None},
    {"id": "A-1006", "amount": 75},
]

def average_order_value(orders):
    total = 0
    count = 0
    for order in orders:
        amount = order.get("amount") or 0
        total += amount
        count += 1
    return total / count

print(average_order_value(orders))