MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / main

Function main

maths/greatest_common_divisor.py:63–77  ·  view source on GitHub ↗

Call Greatest Common Divisor function.

()

Source from the content-addressed store, hash-verified

61
62
63def main():
64 """
65 Call Greatest Common Divisor function.
66 """
67 try:
68 nums = input("Enter two integers separated by comma (,): ").split(",")
69 num_1 = int(nums[0])
70 num_2 = int(nums[1])
71 print(
72 f"greatest_common_divisor({num_1}, {num_2}) = "
73 f"{greatest_common_divisor(num_1, num_2)}"
74 )
75 print(f"By iterative gcd({num_1}, {num_2}) = {gcd_by_iterative(num_1, num_2)}")
76 except IndexError, UnboundLocalError, ValueError:
77 print("Wrong input")
78
79
80if __name__ == "__main__":

Callers 1

Calls 3

gcd_by_iterativeFunction · 0.85
splitMethod · 0.80
greatest_common_divisorFunction · 0.70

Tested by

no test coverage detected