Python Program to Print Even Numbers in a List
This example shows, how to print the even numbers in a list . It iterates the each element list using for loop and check if num%2 == 0,if the given condition is satisfies print the even numbers only.
Example.py
a = [42, 13, 2, 35, 88, 67] for num in a: if num % 2 == 0: print(num)
Output
42 2 88