why is there a position exchange?

Why is there an exchange of "(x, y) = (y, x) if x > y"? If there wasn't such an exchange, does it affect the calculation result if x > y ? Thank you for your time!
pull/221/head
JustinS618 2019-06-28 12:08:08 +08:00 committed by GitHub
parent cc537bd125
commit e36e5dd071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -8,8 +8,6 @@ Date: 2018-03-01
x = int(input('x = '))
y = int(input('y = '))
if x > y:
(x, y) = (y, x)
for factor in range(x, 0, -1):
if x % factor == 0 and y % factor == 0:
print('%d%d的最大公约数是%d' % (x, y, factor))