Only shows one value in returned list

hello, first let me show you my code,
def divisible_by_ten(num):
new_list=

for number in num:
    if(number%10==0):
        new_list.append(number)
        return new_list

print(divisible_by_ten([20, 25, 30, 35, 40]))

This codes only return [20], But I want to return all the integers to new list which is divisible by ten. Can anyone help me out or tell me what did I miss?
Thank you

https://www.codecademy.com/paths/computer-science/tracks/cspath-flow-data-iteration/modules/dspath-python-loops/lessons/python-functions-loops-cc/exercises/divisible-by-ten

Check where your return is. Should it be inside the loop?

2 Likes

Thank you very much :heart_eyes: :heart_eyes: :heart_eyes: :heart_eyes:

1 Like