``` # Python program to find H.C.F of two numbers # define a function def compute_hcf(x, y): # choose the smaller number if x > y: smaller = y else: smaller = x for i in range(1, smaller+1): if((x % i == 0) and (y % i == 0)): hcf = i return hcf num1 = 54 num2 = 24 print("The H.C.F. is", compute_hcf(num1, num2)) ```
author | python-dev |
---|---|
permlink | python-program-to-find-hcf-or-gcd |
category | python-dev |
json_metadata | {"tags":["python-dev"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2020-03-22 10:43:21 |
last_update | 2020-03-22 10:43:21 |
depth | 0 |
children | 0 |
last_payout | 2020-03-29 10:43:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.232 HBD |
curator_payout_value | 0.233 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 376 |
author_reputation | 5,457,648,648,750 |
root_title | "Python Program to Find HCF or GCD" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 96,537,617 |
net_rshares | 1,484,636,251,498 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
xiguang | 0 | 254,455,159,500 | 100% | ||
crypto.income | 0 | 1,230,181,091,998 | 100% |