modulo operation in python - Search