Python Program To Find Factors Of A Number Using While Loop
Example
def factors(x): print("Factors Of {}:".format(x)) i = 1 while(i < (x+1)): d=x%i if d==0: print(i) i+=1 n=18 # n = int(input("Enter Integer Value: ")) factors(n)
Output:
Factors Of 18: 1 2 3 6 9 18