CyborgIntell interview question

Write the binary search to find the lower bound and upper bound in python