Message from Python discussions

December 2018

— K


Hello, guys. I need your help
task: Print all multiplicative factors of an integer
why it is not working?

integer = int(input ("Please, input the integer: "))
print ("Here are all multiplicative factors of number",integer)
print (integer)
for i in range (integer):
c = integer % (integer - 1)
if (c == 0):
print (integer)

— Where?

— There is no any mistake, but it doesn't print for loop

— I don't know why yet

— Try to paste loop before print()

— For i in range (integer) ....

— But where is the condition

— If statement

— I corrected it check this

— While integer >= 0:
for i in range (integer)...... And so on

— Yes