From 37768bfc1eaca38317b62973e3cdfa36a71acc32 Mon Sep 17 00:00:00 2001 From: archit008 <72187362+archit008@users.noreply.github.com> Date: Mon, 2 Nov 2020 07:30:43 +0530 Subject: [PATCH] Create Python Program to Find the Factors of a Number.py --- Python Program to Find the Factors of a Number.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Python Program to Find the Factors of a Number.py diff --git a/Python Program to Find the Factors of a Number.py b/Python Program to Find the Factors of a Number.py new file mode 100644 index 0000000..f0ce830 --- /dev/null +++ b/Python Program to Find the Factors of a Number.py @@ -0,0 +1,12 @@ +# Python Program to find the factors of a number + +# This function computes the factor of the argument passed +def print_factors(x): + print("The factors of",x,"are:") + for i in range(1, x + 1): + if x % i == 0: + print(i) + +num = 320 + +print_factors(num)