another_list = [1, 2, 3, 4, 5, 6]
my_list = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’]
output_list = [another_list[i] if i % 2 == 0 else my_list[i] for i in range(6)]
print(output_list)
This code is perfectly working any other direct method without using for loops, like slicing functions.
I tried the above method.