Skip to content
Snippets Groups Projects
Commit 63622685 authored by Jonas STIRNEMANN's avatar Jonas STIRNEMANN
Browse files

Optimized ifs into ternary

parent 055d6c8a
Branches
No related tags found
No related merge requests found
......@@ -10,10 +10,7 @@ def inverse_mult(a, p) :
pgcd, x, y = pgcd_etendu(a, p)
if pgcd != 1:
return None
if a > p:
return x
else:
return y
return x if a > p else y
if __name__ == "__main__":
print(inverse_mult(3, 11))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment