You keep a money log in your phone notes, one line each like "coffee 12", amounts in whole numbers. Some lines are broken: no amount, an extra word, or an amount that isn't a number. Write ledger_total(lines) to add up the good lines and skip the broken ones.
ledger_total(["coffee 12", "bus 3"])→15ledger_total(["lunch", "tea abc", "snack 5"])→5def ledger_total(lines):
total = 0
for line in lines:
# your code here: split the line in two, turn the amount into an int and add it to total; skip it on ValueError
pass
return total
Run tries the examples. When they look right, Submit.