Created
October 6, 2019 11:00
-
-
Save imedadel/37853980abc2ab341d907ee78ee48beb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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