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.
My code is almost same as yours but my code does not pass case 2,4,5,6. Can you tell what might be wrong?
importsysdefplusMinus(arr):# Complete this functionpos=0neg=0zero=0foriinarr:ifi>0:pos+=1result=float(pos/n)elifi<0:neg+=1num=float(neg/n)else:zero+=1count=float(zero/n)print("%.6f"%result)print("%.6f"%num)print("%.6f"%count)
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 →
My code is almost same as yours but my code does not pass case 2,4,5,6. Can you tell what might be wrong?