From 3b2b7c8c22d1b5a245a9d6604afd0769c07f3cb4 Mon Sep 17 00:00:00 2001 From: asdiadenpotatisen <69951589+asdiadenpotatisen@users.noreply.github.com> Date: Thu, 22 Oct 2020 13:49:11 +0800 Subject: [PATCH] Update t01primeshcflcm_hcf1.py --- t01primeshcflcm_hcf1.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t01primeshcflcm_hcf1.py b/t01primeshcflcm_hcf1.py index 7ea02a8..2dc9e37 100644 --- a/t01primeshcflcm_hcf1.py +++ b/t01primeshcflcm_hcf1.py @@ -1,2 +1,8 @@ # Find the Highest Common Factor (HCF) of 18 and 30. +a = 18 +b = 30 + +while b != 0: + (a, b) = (b, a % b) +print(a)