top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Highest Common Factor Calculation

Writer: Md Ali Mortaza SouravMd Ali Mortaza Sourav

The highest common factor (HCF) is found by finding all common factors of two numbers and selecting the largest one. As we can see, 5 and 25 have common factors of 1 and 5.

Properties

(i) The H.C.F. of two or more numbers cannot be more than one of them.

(ii) If one number is a factor of the other numbers, their H.C.F. will be that smallest number.

(iii) The H.C.F. of the numbers is the product of the common prime factors.

Code

In the function, we first determine the smallest of the two numbers since H.C.F can be less than or equal to only the smallest number. We then use a for loop to go from 1 to that number.


In each iteration, we check whether our number divides both input numbers perfectly. If so, we save the number as H.C.F. When the loop ends, we end with the largest number that divides both numbers perfectly.

 
 

Comments


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page