You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
329 B

def clean_list(shopping_list):
if shopping_list:
cleaned_list = ([f"{index + 1}x/ {item.strip().capitalize()}"
for index, item in enumerate(shopping_list)])
if "milk" not in cleaned_list:
cleaned_list.append("milk")
return cleaned_list
else:
return []