Finding factors of a number in python


 

Finding factors of a number in python using loop upto sqrt(n)

In [1]:
Enter a number: 16
1 16 2 8 4 

Finding factors of a number in python

In [2]:
Enter a number: 12
Factors of  12  are: 
1, 2, 3, 4, 6, 12, 

No comments:

Post a Comment