Iterating over gain ranges with python