Check if a list is empty in Python

PHOTO EMBED

Saved by @bravocoder #python

a = []

if not a:
  print("List is empty")
content_copyCOPY

Using the implicit booleanness of the empty list is quite pythonic.

https://stackoverflow.com/questions/53513/how-do-i-check-if-a-list-is-empty