Determining time complexity of this function in python
Let $T(x)$ denote the running time of the algorithm. The following recurrence captures the running time of the algorithm:


  $T(x)=T(\frac{x}{2})+c,\ x\geq3,\ c \in O(1)$
  where $T(0) = T(1) = a \in O(1)$


Solving this we get, $T(n) \in O(log_2 x)$