From 53fe97f0b639d34fad326d6b0fb79ca87d4b137e Mon Sep 17 00:00:00 2001 From: Gi Soong Chee Date: Mon, 5 Feb 2018 13:21:55 +0800 Subject: [PATCH] added comments for naming and division operator --- Practical 2/q12_find_factors.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Practical 2/q12_find_factors.py b/Practical 2/q12_find_factors.py index 5a42489..b36ad6e 100644 --- a/Practical 2/q12_find_factors.py +++ b/Practical 2/q12_find_factors.py @@ -1,13 +1,13 @@ # Finding the factors of an integer # by Yiyang 29/01/18 - +# gisc: avoid single letter variables and underscore prefix _ in identifier names N = int(input()) i = 2 # i is the factor & the iterator _first = True # for the printing format while (N >= i): if (N % i == 0): - N /= i + N /= i # use integer divisor // in Python 3 if _first == True: print(i, end='') _first = False @@ -16,4 +16,4 @@ else: i += 1 -print('.') \ No newline at end of file +print('.')