Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- required_inputs = int(input("For how many numbers would you like to find their GCD?: "))
- received_inputs = []
- for num in range(0, required_inputs):
- values = int(input())
- received_inputs.append(values)
- if len(received_inputs) == 0:
- values = int(input())
- received_inputs.append(values)
- def GCD(a, b):
- if b == 0:
- return a
- else:
- return GCD(b, a % b)
- print(GCD(received_inputs[0], received_inputs[1]))
Add Comment
Please, Sign In to add comment