How to Create an Empty List in Python - freeCodeCamp.org
Jun 18, 2020 · Because the list was empty, so it evaluates to False. In general: If the list is not empty, it evaluates to True, so the if clause is executed. If the list is empty, it evaluates to False, so the else clause is executed. Example: In the example below, we create an empty list and assign it to the variable num. Then, using a for loop, we add a ...
DA: 56 PA: 11 MOZ Rank: 38