How to check if a list is empty in python

How to check if a list is empty,in this topic you will learn verifying list is empty or not in python language with the help of simple code.

Below is the code:a=[];

I’m checking a is empty or not using for loop as below

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

OR

ALSO READ  Get HTML Source of WebElement in Selenium Webdriver using Python

Selenium Webdriver Using Python – Complete Tutorial Guide

 a = []
 try:
  print(a[-1])
 except IndexError:
  print("List is empty")

Rajesh K