list = [5, 10, 15, 20, 25, 50, 20]
index = list.index(20)
list[index] = 200
print(list)
[5, 10, 15, 200, 25, 50, 20]
list = [10,20,45,20,50,15]
def removeValue(NewList,val):
return [value for value in NewList if value != val]
result= removeValue(list,20)
print(result)
[10, 45, 50, 15]
list1 = [10, 20, 30, 40]
list2 = [100, 200, 300, 400]
for x,y in zip(list1,list2[::-1]):
print(x,y)
10 400 20 300 30 200 40 100