If n is an integer, then (2*n + 1) will always be an odd number regardless of whether n is an even or odd integer. Experiment with different odd and even values of n to confirm this yourself.

Since (2*n + 1) is an odd number, it isn’t divisible by 2.

Hence your if condition if (2*n + 1) % 2 == 0: will never be true, whereas your elif condition elif (2*n + 1) % 2 != 0: will always be true. Unsurprisingly, you end up appending all elements of the original list to new_list.