Wrong output from interviewbit console


#1

I ran the code for inputs A[0, 23], B=[], for in my IDE ans is 11.5 but when i ran the same code in interviewbit console is says my function returns 11.0, i tried refreshing the page but nothing helps.
I kind of stuck here.


#2

I also faced the same problem in python,
Then I realized it happening because of (a+b)/2
So you better use (a+b)*0.5 or (a+b)/2.0 rather than (a+b)/2
It worked fine for me.
Just an addition, if you try to print(a,b) or anything, it will get printed multiple times (screenshot attached)
I hope Interview Bit team will fix this soon


#3

thanks, bro it helps me.