<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Define a function to remove all the even numbers from a list in Python.
sample_list = [1,2,3,4,5,6,7,8]<|im_end|>
<|im_start|>assistant
sample_list = [1,2,3,4,5,6,7,8]

def remove_even_numbers(lst):
    for num in lst:
        if num % 2 == 0:
            lst.remove(num)
    return lst

print(remove_even_numbers(sample_list))<|im_end|>
