What is the runtime of a modulus operation Hi I have an algorithm for which I would like to provide the total runtime:
def foo(x):
    s = []
    if(len(x)%2 != 0):
        return false
    else:
        for i in range(len(x)/2):
          //some more operations
        return true

The loop is in O(n/2) but what is O() of the modulus operation?
I guess it is does not matter much for the overall runtime of the Algorithm, but I would really like to know.

There are two meanings for "run time". Many people have pointed out that if we assume the numbers fit in one register, the mod operaton is atomic and takes constant time.
If we want to look at arbitrary values of $x$, we need to look at the model of computation that is used. The standard way of measuring computational complexity for arbitrary inputs is with the Turing machine model using binary representation for numbers. In this model, the run time to compute $x \% 2$ is $O(\log x)$, which is also the number of bits in the binary representation of $x$. This is because $x \% 2$ is just the last bit of $x$ in binary notation.  
Moreover, it is impossible to use this model and compute the function in time $f(x)$ for any $f$ with $\lim_{x \to \infty} f(x)/\log(x) < 1$. This is because with that sort of bound, there would be values of $x$ large enough that the machine could not even get to the last bit of $x$ before time expires. So, in this strong sense, the run time is "exactly" $\log x$ in the Turing machine model. 
