> For the complete documentation index, see [llms.txt](https://kgisl.gitbook.io/lab3003/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kgisl.gitbook.io/lab3003/manual/lab4-joelanandraj-binarysearch.py.md).

# lab4-joelanandraj-binarysearch.py

\#Solution for BinarySearch

```python
def Bsearch(lst,searchElement):
    lst.sort()
    length=len(lst)
    left=0
    right=length-1

    if length==0:
        return "The list is Empty"


    while(left<=right):
        middle=round((left+right)/2)

        if searchElement==lst[middle]:
            return "The Element is found in the position "+str(middle)
        elif searchElement<lst[middle]:
            right=middle-1
        elif searchElement>lst[middle]:
            left=middle+1

    return "The Element is not present in the list"
```

\##Cyberdojo Link <http://10.100.8.8/kata/edit/A32A2A3D41?avatar=starfish>

####
