Files
why3/examples/python/pgcd.py
paulpatault 3671864507 Python: Added examples
- New examples using the new syntax (+=, ...)
- New examples using the new methods (.pop(), .append(), ...)
- Update old examples with assignement operators (+=, ...)
2021-06-24 11:44:07 +02:00

13 lines
213 B
Python

def pgcd(a, b):
#@ requires a > 0 and b > 0
while a != b:
#@ invariant a > 0 and b > 0
#@ variant a + b
if a < b:
b -= a
else:
a -= b
return a