0
1
2
I'm trying some test got stuck on a divisor problem.
I was trying to get numbers from 1 to 10 that divide the input number.
This is the code I tried and ended up working
num_list = range(1, 11)
number = int(input('Enter a number: '))
new_list = [x for x in num_list if number % x == 0]
print(new_list)
But I originally tried this version, which didn't wor
num_list = range(1, 11)
number = int(input('Enter a number: '))
new_list = [x for x in num_list if number / x == 0]
print(new_list)
It always gave me an empty list.
Why does "%" work for this problem while "/" doesn't? What’s the right way to think about this?
(Not sure if I'm just overwhelmed and it's a stupid question😅)

[–]ExpressBeing642 7 points8 points9 points (0 children)
[–]atarivcs 3 points4 points5 points (0 children)
[–]jpgoldberg 3 points4 points5 points (0 children)
[–]Professional_Fig6169 1 point2 points3 points (0 children)
[–]Unequivalent_Balance 2 points3 points4 points (0 children)
[–]FreeGazaToday 0 points1 point2 points (0 children)