Python: how how to divide elements of arrays based on condition

join shbcf.ru