Skip to content

Instantly share code, notes, and snippets.

@imedadel
Created October 6, 2019 11:00
Show Gist options
  • Save imedadel/37853980abc2ab341d907ee78ee48beb to your computer and use it in GitHub Desktop.
Save imedadel/37853980abc2ab341d907ee78ee48beb to your computer and use it in GitHub Desktop.
def plusMinus(arr):
#
# Write your code here.
#
n = len(arr)
pos = 0
neg = 0
nada = 0
for x in arr:
if x > 0:
pos += 1
elif x < 0:
neg += 1
else:
nada += 1
print(pos/n)
print(neg/n)
print(nada/n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment