# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: 'Python 3.5.6 64-bit (''roadf'': conda)'
#     language: python
#     name: python3
# ---

def Sqrt(a):
    left = 0
    right = a
    
    while left <= right:
        mid = left + (right - left) // 2
        if mid*mid > a:
            right = mid-1
        elif mid*mid < a:
            left = mid+1
        else:
            return mid
    return right


x = 50
# print('The square root of {} is {}.'.format(x, Sqrt(x)))
Sqrt(x)



StarcoderdataJupyterScriptsDedupFiltered