Why does Python give the wrong answer for square root What is integer division in Python 2

0 votes
x = 16

sqrt = x**(.5)  #returns 4
sqrt = x**(1/2) #returns 1

I know I can import math and use sqrt, but I'm looking for an answer to the above. What is integer division in Python 2? This behavior is fixed in Python 3.

May 9, 2022 in Python by Edureka
• 13,730 points

edited Mar 4, 2025 556 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.