def balayage(a,pas): c=coeffdir(a) while c<1: a=... c=coeffdir(...) return a-pas,a