I was not asking what it outputs, and yes I know it is a prime number, if you read the question I was asking if the code only calculated the square root once. If I placed the sqrt part of the code in the function, it will calculate the square root each time it is run and i is incremented, I was purely asking if by placing the input outside the function, does it only calculate the square root once. You have not read my question correctly.