I have two lists in my python code: list_1 = [1, 'Yes', 3, 'No', 5, 'yes', 7] and list_2 = ['a', 'b', 'c']
I want to insert the value of list_2 to list_1 where it is 'yes' or 'no'.
I have tried something like this, by getting the index value of list_1 and tried to insert list_2, but it didn't work.
list_1 = [1, 'Yes', 3, 'No', 5, 'yes', 7]
list_2 = ['a', 'b', 'c']
for (each, i) in zip(list_2, range(len(list_1))):
if list_1 == 'yes' or list_1 == 'no':
list_1.insert(i, each)
for each in list_1:
print(each)
I got only the output of list_1, I want my final list like this f_list=[1, 'a', 3, 'b', 5, 'c', 7] How can I achieve this?