Skip to content

Python code snippet – How to get rid of all null values in array ?

mylist = [1, 2, 3, '', 4]
mylist = [i for i in mylist if i != '']
See also  How to add in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.