Instagram
youtube
Facebook
Twitter

Python Program to Print All Even Numbers in List

   A Python Program to Print All Even Numbers in List

    Short Description:

This program iterates through a list and prints only those elements that are divisible by 2 ✅ Explanation in Points:.

Explanation in Dot Points:

• A list of numbers is created using:
my_list = [11, 22, 33, 44, 55, 66, 77, 88, 99, 100]

• A for loop is used to iterate through each number in the list.

• Inside the loop, the program checks if the number is even using num % 2 == 0.

• If the condition is true, the number is printed as an even number.

Program:

my_list = [11, 22, 33, 44, 55, 66, 77, 88, 99, 100]

print("Even numbers in the list are:")

for num in my_list:

    if num % 2 == 0:

        print(num)