Can anyone help me understand why this loop doesent work?

I am on task 4 in the loops challenge ( Learn Python 3 | Codecademy

When i run the program, nothing prints. This is my code for solving the problem:

def odd_indices(lst): new_list = [] for odd in lst: if odd%2 != 0: lst.append(odd) return new_list

You are appending to the wrong output list. Your code should be:

new_list.append()
2 Likes

There is no print in that code, so nothing prints.

Thank you, I feel stupid now haha