#Find the first occurance of 20 in the given list and replace it with 200
list1=[5,10,15,20,25,50,20]
for index in range(0,len(list1)):
if list1[index]==20:
i= index
break
list2=list1[:i]+[200]+list1[i+1:]
print(list2)
[5, 10, 15, 200, 25, 50, 20]
#Remove all the occurences of item 20 from the given list
list1=[5,20,15,20,25,50,20]
j=[]
for i in list1:
if i!=20:
j.append(i)
print(j)
[5, 15, 25, 50]
# iterate 2 lists at the same time and print list 1 in original order and list 2 in reverse order
list1=[10,20,30,40]
list2=[100,200,300,400]
for i in range (0,len(list1)):
print(list1[i],list2[-(i+1)])
10 400 20 300 30 200 40 100