The note on the fridge says "milk x2, bread, eggs x12": things are split by commas, and the number after x says how many; with no number it's 1. Write count_items(note) to return how many things to buy in all. An empty note gives 0.
count_items("milk x2, bread, eggs x12")→15count_items("")→0def count_items(note):
if note.strip() == "":
return 0
total = 0
for part in note.split(","):
part = part.strip()
# your code here: find " x"; if it's there add the number after it, otherwise add 1
pass
return total
Run tries the examples. When they look right, Submit.