Python is giving you the wrong answer because sqrt=x**(1/2) is doing integer division. 1/2 == 0.
This is the correct answer because you're computing x(1/2) in the first instance, x(0) in the second.
So it's not wrong, it's the right answer to a different question.
To know more about this you can have a look at the following video tutorial:-