Python check whether the list is empty or not

Last Updated On Thursday 20th Jan 2022

python isempty

Example 1

	a=[]

if not a:
  print("Yes,List is empty")
	

Example 2

	a=[]

if len(a) == 0:
    print('The list is empty')
	
	# Yes,List is empty
# The list is empty