Question: 
Write a function to find the ration of negative numbers in an array of integers.


Model's Code:
def negative_count(arr):
    count_negatives = sum(1 for x in arr if x < 0)
    return count_negatives / len(arr) if arr else 0



Sample Correct Code:
from array import array
def negative_count(nums):
    n = len(nums)
    n1 = 0
    for x in nums:
        if x < 0:
            n1 += 1
        else:
          None
    return round(n1/n,2)


Asserts:
assert negative_count([0, 1, 2, -1, -5, 6, 0, -3, -2, 3, 4, 6, 8])==0.31
assert negative_count([2, 1, 2, -1, -5, 6, 4, -3, -2, 3, 4, 6, 8])==0.31
assert negative_count([2, 4, -6, -9, 11, -12, 14, -5, 17])==0.44


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

Test 530 of 974: 390/530 (73.58490566037736%): failed