Kodewick
Start learning →
Starter←→0 / 100

Receipt total

#046StarterListsNumbers2 min

A bakery receipt lists the price of each thing bought. Write receipt_total(prices) to return the total. Nothing bought (an empty list) means 0.

Examples
receipt_total([12, 8, 5])→25
receipt_total([])→0
main.py
def receipt_total(prices):
    # your code here: add up all the prices
    return 0
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.