Assignment#4 : Mohammed Abdul Wasay

  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]

  1. 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]

  1. 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