Call Greatest Common Divisor function.
()
| 61 | |
| 62 | |
| 63 | def 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 | |
| 80 | if __name__ == "__main__": |
no test coverage detected