

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- 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
- Check whether a NavigableMap empty or not in Java
- Check whether IdentityHashMap empty or not in Java?
- Python program to check if the string is empty or not
- 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 whether a given string is Heterogram or not
- Java Program to check if a string 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
- C++ Program to Check Whether a Number is Prime or Not
- C++ Program to Check Whether a Number is Palindrome or Not
- C Program to Check Whether a Number is Prime or not?
Advertisements