Write a Python program to delete all occurrences of a given number from a list
lst=[2,2,3,5,7,2,9]
def remove_all(num, lst):
    result = []
    for i in range(len(lst)):
        if lst[i] != num:
            result.append(lst[i])
    return result