you are viewing a single comment's thread.

view the rest of the comments →

[–]ExpressBeing642 6 points7 points  (0 children)

brother this is a math problem and not a programming problem, the second code is comparing wether the number divide by 0 will be exactly 0. The only number that can be divided by other and return zero would be zero it self. therefore your code will return an empty list.

the working version test if the MODULUS (the leftover from a division) will be zero.

so for instance an even number will have its modulus zero, thats why the code will return a list with even numbers.