Daniel Díaz Asked: 2020-08-25 07:08:00 +0800 CST 2020-08-25 07:08:00 +0800 CST 2020-08-25 07:08:00 +0800 CST What is the best way to check if a list is empty? 772 Empty list example: a = [] How to check if it is empty or not? python 1 Answers Voted Best Answer Daniel Díaz 2020-08-25T07:08:00+08:002020-08-25T07:08:00+08:00 Option 1: if not a: print("La lista está vacía") Option 2: if len(a) == 0: print("La lista está vacía")
Option 1:
Option 2: