This response could be considered as a variation of the response of @Selcuk
n = int( input( "Enter an integer: " ))
def getSecondLargestDivisor( num ):
findSecond = False
for i in range( 2, num ):
if num % i == 0:
if not findSecond:
findSecond = True
else:
return num / i
return 1
print( getSecondLargestDivisor( n ) )