Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def findGreatestCommonDivisor(a, b):
  2.     while a != b:
  3.         if a > b:
  4.             a = a - b
  5.             return findGreatestCommonDivisor(a, b)
  6.         elif a <= b:
  7.             b = b - a
  8.             return findGreatestCommonDivisor(a, b)
  9.     return a
  10.    
  11. print findGreatestCommonDivisor(12387, 1239)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement