Computer Science Related Others Courses AvailableThe Best Codder.blogspot.com

How to Find Factors of Number using Python?

How to Find Factors of Number using Python?
0 min read

 

How to Find Factors of Number using Python?


num=int(input("enter a number"))

factors=[]

for i in range(1,num+1):

    if num%i==0:

       factors.append(i)


print ("Factors of {} = {}".format(num,factors))


Output

enter a number75

Factors of 75 = [3, 5, 15, 25, 75]

Post a Comment

© 2025Python . The Best Codder All rights reserved. Distributed by