We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def plusMinus(arr):
# Write your code here
i_p =
i_n =
i_z = 0
s = len(arr)
for num in arr:
if num > 0:
i_p +=1
elif num <0:
i_n +=1
else:
i_z +=1
print(i_p/s)
print(i_n/s)
print(i_z/s)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
def plusMinus(arr): # Write your code here i_p = i_n = i_z = 0 s = len(arr) for num in arr: if num > 0: i_p +=1 elif num <0: i_n +=1 else: i_z +=1 print(i_p/s) print(i_n/s) print(i_z/s)