• + 1 comment

    That's because math.pow() will use floating-point numbers. It is more typically used when the power is a real number, not (necessarily) an integer.

    To raise integers to an integer power, use the exponentiation operator **:

    third = second**2 + first
    

    (Of course to compute a square of x, x*x works just fine as well.)