Assignment – 4 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. Given input : list1 = [5, 10, 15, 20, 25, 50, 20] Expected output: [5, 10, 15, 200, 25, 50, 20] Ans:- Input_List = [5,10,15,20,25,50,20] print("Input List : ",Input_List) first_occurance_Index = Input_List.index(20) Input_List[first_occurance_Index] = 200 print("Updated List : ",Input_List) Output:- ========   Input List : [5, 10, 15, 20, 25, 50, 20] Updated List : [5, 10, 15, 200, 25, 50, 20] ======================================================= 2. Given a Python list, write a program to remove all occurrences of item 20. Given input : list1 = [5, 20, 15, 20, 25, 50, 20] Expected output:[5, 15, 25, 50] Ans:- ===== Input_List = [5,10,15,20,25,50,20] print("Input List : ",Input_List) try: while True: Input_List.remove(20) except ValueError: pass print("Updated List : ",Input_List) Output:- =======   Input List : [5, 10, 15, 20, 25, 50, 20] Updated List : [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. Given input : list1 = [10, 20, 30, 40] list2 = [100, 200, 300, 400] Expected output: 10 400 20 300 30 200 40 100 Ans:- ===== list1 = [10, 20, 30, 40] list2 = [100, 200, 300, 400] list2.sort(reverse = True) for i in range(len(list1)): print(str(list1[i])+" "+str(list2[i])) OutPut:- =======   10 400 20 300 30 200 40 100