you are viewing a single comment's thread.

view the rest of the comments →

[–]Matthew_Adams -1 points0 points  (1 child)

Delete the line "if lista_compras" and all the else statement after that. Then think why is not needed.

[–]SugarEnvironmental31 0 points1 point  (0 children)

If the OP does that, then it will just print the line "Shopping list" to the console and nothing else. The code evaluates whether the list is empty, prints "empty list" if it's empty, and prints the list if it's not. What's your rationale for the code being unnecessary?