Factor a number into prime factors
📁 Advanced Python Topics, example, python3
How to factor a number into multipliers in Python so that their product equals this number.
number = int(input("Enter an integer: "))
for i in range(1, number+1):
if (number % i == 0):
print(i)
When entering the number (for example) 63, the output is:
1
3
7
9
No answers yet.
Log in to leave an answer
Blogs