Browse Source

test(clean_the_list): fix wrong test output

pull/1779/head
eslopfer 1 year ago
parent
commit
ed8474e3cc
  1. 9
      sh/tests/student/shopping.py

9
sh/tests/student/shopping.py

@ -0,0 +1,9 @@
def clean_list(shopping_list):
if shopping_list:
cleaned_list = ([f"{index + 1}/ {item.strip().capitalize()}"
for index, item in enumerate(shopping_list)])
if "Milk" not in shopping_list:
cleaned_list.append(f"{len(cleaned_list)}/ Milk")
return cleaned_list
else:
return []
Loading…
Cancel
Save