I have the following code:
for n in range(1, 101):
if 100 % n == 0:
print(n, end='')
I want to print all divisors of 100
. However, I want them in one line (which I accomplish by putting end=''
in the code). On top of that, I want commas between the numbers. I want to have an output like this:
1, 2, 4, 5, 10, 20, 25, 50, 100
sep=','
does not work because of the loop it is in. end=','
will work, but this will lead to a comma after 100, which is not what I want.