Write a program to remove all occurrence of a given number from the list
Topic: Write a program to remove all occurrence of a given number from the list
Solution
num1 = 20 list1 = [5, 20, 15, 20, 25, 50, 20] def removeValue(sampleList, val): return [value for value in sampleList if value != val] resList = removeValue(list1, num1) print(resList)
List all Python Programs