Inactive Tutor answered 06/23/19
Tutor
New to Wyzant
Even simpler in Python:
if !a:
# This is executed if the list is empty
else:
# This is executed if the list is not empty
Inactive Tutor answered 06/23/19
Even simpler in Python:
if !a:
# This is executed if the list is empty
else:
# This is executed if the list is not empty
Inactive Tutor answered 06/22/19
The simplest way would be to check the length of the list. An empty list has a length of 0.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.