# 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]
index = list1.index(20)
list1[index] = 200
print(list1)
# Write a program to remove all occurrences of item 20.
list1 = [5, 20, 15, 20, 25, 50, 20]
def remove_value(sample_list, val):
return [i for i in sample_list if i != val]
res = remove_value(list1, 20)
print(res)
# 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]
for x, y in zip(list1, list2[::-1]):
print(x, y)
!jupyter nbconvert Assignment_4 (3).ipynb