About 5,980 results
Open links in new tab
  1. Python Program to Find the Gcd of Two Numbers - GeeksforGeeks

    Feb 22, 2025 · The task of finding the GCD (Greatest Common Divisor) of two numbers in Python involves determining the largest number that divides both input values without leaving a …

  2. Code for Greatest Common Divisor in Python - Stack Overflow

    Jun 24, 2012 · The greatest common divisor (GCD) of a and b is the largest number that divides both of them with no remainder. One way to find the GCD of two numbers is Euclid’s …

  3. How to find greatest common divisor using recursive function in Python

    Dec 2, 2019 · The condition says that: if y is equal to 0 then gcd (x,y) is x; otherwise gcd (x,y) is gcd (y,x%y). To try the code, I am asked to obtain two integers from the user. Here is what I …

  4. Python Program to find GCD of Two Numbers - Tutorial Gateway

    Write a Python program to find the GCD of two numbers using While Loop, Functions, and Recursion. To find the GCD or HCF, we must pass at least one non-zero value.

  5. 3 ways to find the Greatest Common Divisor in Python

    Sep 10, 2020 · Besides using the built-in gcd() function, we can use a while loop to find the greatest common divisor of two integers in Python. To do that, we use the while loop to …

  6. How to Find GCD of Two Numbers in Python – allinpython.com

    Find GCD of two numbers Using Built-in Function The math module includes a function called math.gcd() that helps us find the greatest common divisor (GCD) of two or more integers.

  7. Python GCD Finder Function (Greatest Common Divisor)

    Learn how to find the Greatest Common Divisor (GCD) of two numbers in Python with a simple function and clear explanation.

  8. GCD of Two Numbers in Python - Sanfoundry

    Learn how to find the GCD of two numbers in Python using different methods like math and fractions modules, recursion and Euclidean algorithm.

  9. GCD of Two Numbers in Python: Easiest Methods to Calculate

    Calculating the GCD of two numbers in Python is straightforward with the help of built-in tools and efficient algorithms. This article will explain various methods to compute the GCD, such as the …

  10. Python Program to Find GCD or HCF of two numbers

    How to find gcd of two numbers # taking first number num1 = int (input ("Enter first number: ")) # taking second number num2 = int (input ("Enter second number: ")) gcd = 1 # finding GCD for i …

  11. Some results have been removed
Refresh