Why do you need the minimum == 0 test in the following chunk of code ...
if i > 0 and (minimum == 0 or i < minimum):
minimum = i if i > 0 and (minimum == 0 or i < minimum):
minimum = i