question archive Full Code Coverage Given a function, write assert statements & function calls to ensure that every line of the function definition is executed at least once
Subject:Computer SciencePrice: Bought3
Full Code Coverage Given a function, write assert statements & function calls to ensure that every line of the function definition is executed at least once. For each test, indicate which line(s) of code are executed. sum67(num_list) takes a list of integers, and returns the sum of the numbers in the list, except it ignores sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by one 7). Return 0 for no numbers. For example, assert sum67 ( [1, 1, 6, 1, 7, 2]) 4#NOTE:you cannot use this exact test 1 def sum67 (num list) : 2 assert type (num list) == list 3 for v in num list: #verify that all elements are integers 4 assert type (v) == int 5 sum = 0 6 flag67 = false 7 for v in num list: 8 if v == 6: 9 flag67 = True 10 elif v == 7: 11 flag67 = False 12 if not flag67 and not v == 7: 13 sum += v 14 return sum Testing code(asserts & function calls) Code Lines Executed Example: sum67 ( '6, 7') 1, 2 (Example only: you must create a unique non-string test)