Q:

Write a Python program to remove None value from a given list

0

Write a Python program to remove None value from a given list. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def remove_none(nums):
    result = [x for x in nums if x is not None]
    return result
nums = [12, 0, None, 23, None, -55, 234, 89, None, 0, 6, -12]
print("Original list:")
print(nums)
print("\nRemove None value from the said list:")
print(remove_none(nums))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now