
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Python program to check whether a list is empty or not?
Given an empty list. Our task is to check weather this list is empty or not. Here we check is an implicit way of checking.
Algorithm
Step 1: We take an empty list. Step 2: then check if list is empty then return 1 otherwise 0.
Example Code
# Python code to check for empty list def checklist(A): if not A: return 1 else: return 0 # Driver Code A = [] if checklist(A): print ("The list is Empty") else: print ("The list is not empty")
Output
The list is Empty
- Related Articles
- C# program to check whether a list is empty or not
- Check whether a Stack is empty or not in Java
- Check whether a HashSet is empty or not in Java
- Program to check whether given list is in valid state or not in Python
- Program to check whether list is alternating increase and decrease or not in Python
- Python program to check if the string is empty or not
- Check whether a NavigableMap empty or not in Java
- Python program to check whether a given string is Heterogram or not
- Check whether IdentityHashMap empty or not in Java?
- Program to check whether list of points form a straight line or not in Python
- Java Program to check if a string is empty or not
- C# Program to Check a HashTable collection is empty or not
- Program to check whether a binary tree is complete or not in Python
- Program to check whether a binary tree is BST or not in Python
- Python Program to Check Whether a String is a Palindrome or not Using Recursion

Advertisements