#--input
a=a = int(input("Enter a number: "))
print() # new line
b=b = int(input("Enter a number: "))
print() # new line
#--check/make a > b only once
if (b>ab > a):
a,b=bb = b,a
#--one simple loop for GCD
while(a%b !=0= 0):
x,a=aa = a,b
b=x%bb = x%b
#--If one or both values are negative
if(b<0b < 0):
b*=b *= -1
print ("GCD=""GCD = ", b)
Try this. It has one small loop for GCD. And -ve value correction. I've added comments to describe the code.