def new_list(lst):
for i in lst:
if i%10 == 0:
return i
else:
return False
print(new_list([10, 20.0, 25, 30, 40, 98]))
i want to see all numbers from the list that can be divided into 10
>Solution :
This can also be done with a list comprehension:
def new_list(lst):
return [x for x in lst if x % 10 == 0]