Project: Find the factors

Write a program that asks for a positive integer and prints every positive integer that divides it evenly, including 1 and the number itself, in ascending order. When you run it, the output should match this format:

Please enter a positive integer: 12
The factors of 12 are:
1
2
3
4
6
12

Save the file as find_factors.py.

Show a solution

Try the project on your own first. This is one working solution. Press Run, and a box asks for each input. Type the sample values from the project description to see the same output.

These tests check the solution above. They run a copy of the program, kept in PROGRAM, and give it pretend input. The testing tools here are not part of the course yet, so do not worry about how they work. Read the test names and the expected outputs: together they list what the program must do. Press Run to run the tests.

Projects run on your own computer, so you tell us when you are done.