Write a Python program to check a list is empty or not


This program checks whether a given list "a" is empty or not. It uses an if-else statement to check if the list is empty or not. The if statement uses the 'not' keyword to check if the list "a" is empty or not. If the list is empty, then it will print "List is Empty.." Otherwise, it will print "List is Not Empty.."

Source Code

a = []
#a = [34,45,6,5,4,56,7]
if not a:
  print("List is Empty..")
else:
  print("List is Not Empty..")
 

Output

List is Empty..

Example Programs