import math from array import array def zero_count(nums): n = len(nums) n1 = 0 for x in nums: if x == 0: n1 += 1 else: None return n1/(n-n1)