Fault Interactions

March 1, 2017

8

def sum(lst):

i, result=2, 0

while i <= len(lst):

result+=lst[i]

i += 1

return result

assert sum[1,0] = 1 0

def sum(lst):

i, result=1, 0

while i <= len(lst)-1:

result+=lst[i]

i += 1

return result

assert sum[0,1] = 1 0

def sum(lst):

i, result=1, 0

while i <= len(lst):

result+=lst[i-1]

i += 1

return result

assert sum[1,0] = 1

assert sum[0,1] = 1

def sum(lst):

i, result=2, 0

while i <= len(lst)-1:

result+=lst[i-1]

i += 1

return result

assert sum[1,0] = 1 0

assert sum[0,1] = 1 0

Original