Q1) 28 points 3 in x True Y ** 0 1.0 x[1] values[len(values)-1] +1 return False # if they use AND then +2 for return False as one +1 return True 4 points for header 2 points for valid input 2 points for 'for' 2 points for proper range-loop 1 point for : at end of for 2 points for if 2 points for if-low condition 1 point for return False when too low 1 point for return False when too high 2 points for if-high condition 1 point for return True Q3) 18 points +1 +1 +1 +1 def isSequence(values): +2 diff = values[1] - values[0] +2 +1 +1 +1 for i in range(len(values)-1): +1 +1 +1 +1 +1 if values[i+1]-values[i] != diff: +1 return False +1 return True 4 points for header 2 points for capturing difference properly 2 points for 'for' 1 point for range-loop 1 point for subtracting 1 1 point for : at end of for 1 points for if 1 point for proper difference (values[i+1] - values[i]) 1 point for != 1 point for comparing against diff 1 point for : 1 point for return False 1 point for return True -------------------------------------------------------------------------------- Q4: Number of defects. 2 for circling and 2 for fixing (a) def not define (b) must have comma between values and target in function definition (c) must use different variable name in for loop (not target) (d) must either say range(len(values)) or values (e) count must be defined before for loop as zero (f) return count must not be in the ‘if’ indentation but must be at the ‘for’ indentation Q5: (a) program prints 2 as output (b) value of other is [5, 2, 1] (c) any list that contains unique numbers