Question: 
Write a python function to check whether the last element of given array is even or odd after performing an operation p times.


Model's Code:
def check_last(arr, p, operation):
    for _ in range(p):
        arr[-1] += operation
    return "EVEN" if arr[-1] % 2 == 0 else "ODD"



Sample Correct Code:
def check_last (arr,n,p): 
    _sum = 0
    for i in range(n): 
        _sum = _sum + arr[i] 
    if p == 1: 
        if _sum % 2 == 0: 
            return "ODD"
        else: 
            return "EVEN"
    return "EVEN"
      


Asserts:
assert check_last([5,7,10],3,1) == "ODD"
assert check_last([2,3],2,3) == "EVEN"
assert check_last([1,2,3],3,1) == "ODD"


Tests:
Test 1 of 3: PASS
Test 2 of 3: FAIL: AssertionError()

Test 134 of 974: 100/134 (74.6268656716418%): failed