I want to write a function which takes a list of numbers and returns another list with elements divisible by 5. However, I keep getting the error 'nlist is not defined' and I dont know where am I making a mistake.
this is the function that I wrote:
def divisible_by_five(numbers):
nlist = []
for i in range(0, len(numbers)):
if numbers[i] % 5 == 0:
nlist.append(numbers[i])
print('your list is: ', nlist)
f = [1,2,3,4,5,55,65,75]
divisible_by_five(f)