Step 4 – printing the answer
The last part of the program simply prints out the Highest Common Factor.
This is just one line of Python code. It shouldn't be indented at all.
- Save your program
- Run your program several times
- Try simple numbers and bigger ones.
- Try a prime number. The HCF should always be 1 if either of the numbers you enter are prime numbers
That's the basic program done. Click here to extend it to three numbers