#1. You have given a Python list. Write a program to find value 20 in the list, and if it is present, replace it with 200. Only update the first occurrence of an item.
list1=[5,10,15,20,25,50,20]
list1[:]=[x if x!=20 else 200 for x in list1]
print(list1)
[5, 10, 15, 200, 25, 50, 200]
#2. Given a Python list, write a program to remove all occurrences of item 20.
list1=[5,10,15,20,25,50,20]
list1[:]=(value for value in list1 if value!=20)
print(list1)
[5, 10, 15, 25, 50]
#3. Given a two Python list. Write a program to iterate both lists simultaneously and display items from list1 in original order and items from list2 in reverse order.
list1=[10,20,30,40]
list2=[100,200,300,400]
list2.reverse()
for f,s in zip(list1,list2):
print(f,' ',s)
10 400 20 300 30 200 40 100