🚨 Lint the code
Using `black`, `pylint` & `flake8` relate to forga/process/fr/embarquement#6
This commit is contained in:
parent
a62dc1aaa4
commit
53ef01ad09
|
@ -17,10 +17,10 @@ The goal is to build durable python script using standard library
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def pgcd(a,b):
|
def pgcd(input_a, input_b):
|
||||||
"""
|
"""
|
||||||
This function find the Greatest Common Divisor (PGCD in French)
|
This function find the Greatest Common Divisor (PGCD in French)
|
||||||
between a & b
|
between input_a & input_b
|
||||||
|
|
||||||
:Tests:
|
:Tests:
|
||||||
>>> pgcd(561, 357)
|
>>> pgcd(561, 357)
|
||||||
|
@ -32,18 +32,19 @@ def pgcd(a,b):
|
||||||
>>> pgcd(910, 42)
|
>>> pgcd(910, 42)
|
||||||
14
|
14
|
||||||
"""
|
"""
|
||||||
rest = a - b
|
rest = input_a - input_b
|
||||||
check = b - rest
|
check = input_b - rest
|
||||||
|
|
||||||
while check != 0:
|
while check != 0:
|
||||||
a = max(b, rest)
|
input_a = max(input_b, rest)
|
||||||
b = min(b, rest)
|
input_b = min(input_b, rest)
|
||||||
rest = a - b
|
rest = input_a - input_b
|
||||||
check = max(b, rest) - min(b, rest)
|
check = max(input_b, rest) - min(input_b, rest)
|
||||||
|
|
||||||
print(rest)
|
print(rest)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
|
|
||||||
doctest.testmod()
|
doctest.testmod()
|
||||||
|
|
Loading…
Reference in New Issue