1 2 3 4 5 6 7 8 9 10
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)