Misc problems and algorithms implemented in Python