Files
codeql/python/ql/src/Statements/C_StyleParentheses.py
2018-11-19 15:10:42 +00:00

24 lines
402 B
Python

#Written in Java or C style
def gcd(a, b):
while(a != 0 and b != 0):
if(a > b):
a = a % b
else:
b = b % a
if(a == 0):
return (b)
return (a)
#Written in a more Pythonic style
def gcd(a, b):
while a != 0 and b != 0:
if a > b:
a = a % b
else:
b = b % a
if a == 0:
return b
return a