Write a program to remove odd numbers from a list using list comprehensions


Topic: Write a program to remove odd numbers from a list using list comprehensions

Solution

nums = [1, 2, 3, 4, 5, 6, 7, 8]
no_odd_nums = [i for i in nums if i % 2 == 0]



List all Python Programs