how to remove none in python

Not_none_values = filter(None.__ne__, list_of_values)
list_of_values = list(Not_none_values)

Here is what the above code is Doing:
1. We’re creating a list of values that we want to filter.
2. We’re using the filter function to filter out all the values that are None.
3. We’re converting the filtered values back into a list.
4. We’re assigning the filtered list to the original list.