Files
2024-01-24 19:52:36 +01:00

878 B

id, title, challengeType, dashedName
id title challengeType dashedName
65822934c8a0454803e3ef12 Schritt 8 20 step-8

--description--

Next, you are going to display the details for each expense.

Inside the for loop, replace pass with a print() call and pass it the following f-string: f'Amount: {expense}, Category: {expense}'. Leave the placeholders empty for now.

--hints--

You should have print(f'Amount: {expense}, Category: {expense}') in your for loop.

({ test: () => assert.match(code, /^\s+print\s*\(\s*f("|')Amount: \{\s*expense\s*\}, Category: \{\s*expense\s*\}\1\s*\)/m) })

--seed--

--seed-contents--

def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})

--fcc-editable-region--
def print_expenses(expenses):
    for expense in expenses:
        pass
--fcc-editable-region--

expenses = []