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.
**here is python code for this problem **
def plusMinus(arr):
# Write your code here
lent = len(arr)
zer,pos,neg = [],[],[]
for i in arr:
if i > 0:
pos.append(i)
elif i<0:
neg.append(i)
else:
zer.append(i)
p=float(len(pos))/lent
n=float(len(neg))/lent
z=float(len(zer))/lent
Plus Minus
You are viewing a single comment's thread. Return to all comments →
**here is python code for this problem ** def plusMinus(arr): # Write your code here lent = len(arr) zer,pos,neg = [],[],[] for i in arr: if i > 0: pos.append(i) elif i<0: neg.append(i) else: zer.append(i) p=float(len(pos))/lent n=float(len(neg))/lent z=float(len(zer))/lent