isempty 1.0.1
is_empty
Python package to check whether a variable is empty or not.
Description
Installation
Examples
Author
License
Description
The package has two functions named empty() and not_empty() which can check if a variable is empty or not.
The following values evaluate to empty:
0
0.0
""
None
False
[]
()
{}
set()
b""
Installation
To install, write the following command in your terminal.
pip install is_empty
Examples
Import the functions to your code.
from is_empty import empty, not_empty
Check whether a list is empty or not using empty().
#The function will return True in this case
items = []
if empty(items):
#Do something
else:
#Do something else
Check whether a tuple is not empty using not_empty.
#The function will return True in this case
items = (1,2,3)
if not_empty(items):
#Do something
Author
Wahid Sadique Koly
Github
Portfolio
License
This project is licensed under the MIT License - see the LICENSE file for details
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.