Write a program to print the elements of an array present on even position


Topic: Write a program to print the elements of an array present on even position

Solution

arr = [1, 2, 3, 4, 5];     
     
print("Elements of given array present on even position: ");    
    
for i in range(1, len(arr), 2):    
    print(arr[i]);   
    



List all Python Programs