21 Program to select the even items of a list using Python

Program:

l = list()

l = [x for x in input("Enter any number of value: ").split()]



length = len(l)



print("Even items:",end=" ")



for i in range(0,length,2):

    print(l[i],end=" ")


Output:

Program to select the even items of a list using Python

Previous
Next Post »