MAX_MINES = 50 LEVELS = [ [5, 10], [50, 20], [75, 30], [100, 40] ] def num_mines(score): for limit, n in LEVELS: if score < limit: return n return MAX_MINES ''' if score < 5: num_mines = 10 if 10 <= score <50: num_mines = 20 if 50 <= score <75: num_mines = 30 if 75 <= score <100: num_mines = 40 #else: #num_mines = 50 return num_mines '''