Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

hcf program in python

def hcf(x, y):  
   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 = int(input("Enter first number: "))  
num2 = int(input("Enter second number: "))  
print("The H.C.F. of", num1,"and", num2,"is", hcf(num1, num2))  
Comment

PREVIOUS NEXT
Code Example
Python :: closing text files in python 
Python :: python print a help of a script 
Python :: binary to text python 
Python :: regex to find ip address python 
Python :: convert c_ubyte_Array_ to opencv 
Python :: find index of max value in 2d array python 
Python :: python convert xd8 to utf8 
Python :: def __init__ python not overwrite parrent class 
Python :: error popup in django not visible 
Python :: python sqlite3 input multiple sql statement 
Python :: arweave python 
Python :: py to exe converter online 
Python :: pandas show complete string 
Python :: how to put iput python 
Python :: python markdown indent 
Python :: multiple loss pytorch 
Python :: divide by zero errors when using annotate 
Python :: what do i do if my dog eats paper 
Python :: write a program to check whether a character is vowel or consonant in python 
Python :: convert string array to integer python 
Python :: how to save inputs python 
Python :: pandas replace values in column based on condition 
Python :: pytube search feature 
Python :: datetime python 
Python :: skewness python 
Python :: date format in django template 
Python :: How to to efficiently find the first index in a sorted array of distinct numbers that is equal to the value at that index? 
Python :: guido van rossum net worth 
Python :: hand tracking module 
Python :: dataframe index rename 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =